Merge pull request #5039 from CEikermann/patch-1
[vuplus_xbmc] / xbmc / rendering / RenderSystem.cpp
1 /*
2  *      Copyright (C) 2005-2013 Team XBMC
3  *      http://xbmc.org
4  *
5  *  This Program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This Program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with XBMC; see the file COPYING.  If not, see
17  *  <http://www.gnu.org/licenses/>.
18  *
19  */
20
21 #include "RenderSystem.h"
22
23 CRenderSystemBase::CRenderSystemBase()
24 {
25   m_bRenderCreated = false;
26   m_bVSync = true;
27   m_maxTextureSize = 2048;
28   m_RenderVersionMajor = 0;
29   m_RenderVersionMinor = 0;
30   m_renderCaps = 0;
31   m_renderQuirks = 0;
32   m_minDXTPitch = 0;
33 }
34
35 CRenderSystemBase::~CRenderSystemBase()
36 {
37
38 }
39
40 void CRenderSystemBase::GetRenderVersion(unsigned int& major, unsigned int& minor) const
41 {
42   major = m_RenderVersionMajor;
43   minor = m_RenderVersionMinor;
44 }
45
46 bool CRenderSystemBase::SupportsNPOT(bool dxt) const
47 {
48   if (dxt)
49     return (m_renderCaps & RENDER_CAPS_DXT_NPOT) == RENDER_CAPS_DXT_NPOT;
50   return (m_renderCaps & RENDER_CAPS_NPOT) == RENDER_CAPS_NPOT;
51 }
52
53 bool CRenderSystemBase::SupportsDXT() const
54 {
55   return (m_renderCaps & RENDER_CAPS_DXT) == RENDER_CAPS_DXT;
56 }
57
58 bool CRenderSystemBase::SupportsBGRA() const
59 {
60   return (m_renderCaps & RENDER_CAPS_BGRA) == RENDER_CAPS_BGRA;
61 }
62
63 bool CRenderSystemBase::SupportsBGRAApple() const
64 {
65   return (m_renderCaps & RENDER_CAPS_BGRA_APPLE) == RENDER_CAPS_BGRA_APPLE;
66 }
67
68 bool CRenderSystemBase::SupportsStereo(RENDER_STEREO_MODE mode) const
69 {
70   switch(mode)
71   {
72     case RENDER_STEREO_MODE_OFF:
73     case RENDER_STEREO_MODE_SPLIT_HORIZONTAL:
74     case RENDER_STEREO_MODE_SPLIT_VERTICAL:
75     case RENDER_STEREO_MODE_MONO:
76       return true;
77     default:
78       return false;
79   }
80 }
81