added: BGRA texture checks for GLES
authortheuni <theuni-nospam-@xbmc.org>
Sat, 9 Jul 2011 15:26:36 +0000 (11:26 -0400)
committertheuni <theuni-nospam-@xbmc.org>
Sun, 10 Jul 2011 04:16:34 +0000 (00:16 -0400)
Apple uses a different string so we need to check for both. In addition,
Apple's usage is different, so it's not sufficient to return true if
either is found.

xbmc/rendering/RenderSystem.cpp
xbmc/rendering/RenderSystem.h
xbmc/rendering/gles/RenderSystemGLES.cpp

index 81f03f6..cc56e77 100644 (file)
@@ -54,3 +54,14 @@ bool CRenderSystemBase::SupportsDXT() const
 {
   return (m_renderCaps & RENDER_CAPS_DXT) == RENDER_CAPS_DXT;
 }
+
+bool CRenderSystemBase::SupportsBGRA() const
+{
+  return (m_renderCaps & RENDER_CAPS_BGRA) == RENDER_CAPS_BGRA;
+}
+
+bool CRenderSystemBase::SupportsBGRAApple() const
+{
+  return (m_renderCaps & RENDER_CAPS_BGRA_APPLE) == RENDER_CAPS_BGRA_APPLE;
+}
+
index fc8c271..5a55c79 100644 (file)
@@ -49,7 +49,9 @@ enum
 {
   RENDER_CAPS_DXT      = (1 << 0),
   RENDER_CAPS_NPOT     = (1 << 1),
-  RENDER_CAPS_DXT_NPOT = (1 << 2)
+  RENDER_CAPS_DXT_NPOT = (1 << 2),
+  RENDER_CAPS_BGRA     = (1 << 3),
+  RENDER_CAPS_BGRA_APPLE = (1 << 4)
 };
 
 class CRenderSystemBase
@@ -94,6 +96,8 @@ public:
   const CStdString& GetRenderRenderer() const { return m_RenderRenderer; }
   const CStdString& GetRenderVersionString() const { return m_RenderVersion; }
   bool SupportsDXT() const;
+  bool SupportsBGRA() const;
+  bool SupportsBGRAApple() const;
   bool SupportsNPOT(bool dxt) const;
   unsigned int GetMaxTextureSize() const { return m_maxTextureSize; }
   unsigned int GetMinDXTPitch() const { return m_minDXTPitch; }
index a9d10bf..05aa1d1 100644 (file)
@@ -95,6 +95,18 @@ bool CRenderSystemGLES::InitRenderSystem()
     m_renderCaps |= RENDER_CAPS_NPOT;
   }
 
+  if (IsExtSupported("GL_IMG_texture_format_BGRA8888"))
+  {
+    m_renderCaps |= RENDER_CAPS_BGRA;
+  }
+
+  if (IsExtSupported("GL_APPLE_texture_format_BGRA8888"))
+  {
+    m_renderCaps |= RENDER_CAPS_BGRA_APPLE;
+  }
+
+
+
   m_bRenderCreated = true;
   
   InitialiseGUIShader();