Commits

Murat Sari  committed 41f1acb

GLES: Fix build on iOS

  • Participants
  • Parent commits 1840c08
  • Branches v1-9

Comments (0)

Files changed (3)

File RenderSystems/GLES/include/OgreGLESRenderSystem.h

               */
             GLESRTTManager *mRTTManager;
 
+            /// Mask of buffers who contents can be discarded if GL_EXT_discard_framebuffer is supported
+            unsigned int mDiscardBuffers;
+        
             /// Check if the GL system has already been initialised
             bool mGLInitialised;
 
              */
             void setScissorTest(bool enabled, size_t left = 0, size_t top = 0, size_t right = 800, size_t bottom = 600);
 
+            void _setDiscardBuffers(unsigned int flags) { mDiscardBuffers = flags; }
+            unsigned int getDiscardBuffers(void) { return mDiscardBuffers; }
+        
             void clearFrameBuffer(unsigned int buffers,
                 const ColourValue& colour = ColourValue::Black,
                 Real depth = 1.0f, unsigned short stencil = 0);

File RenderSystems/GLES/src/OgreGLESHardwarePixelBuffer.cpp

                 switch(mTarget)
                 {
                     case GL_TEXTURE_2D:
+#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
                     case GL_TEXTURE_CUBE_MAP_OES:
+#endif
                         glCopyTexSubImage2D(mFaceTarget, mLevel, 
                                             dstBox.left, dstBox.top, 
                                             0, 0, dstBox.getWidth(), dstBox.getHeight());

File RenderSystems/GLES/src/OgreGLESRenderSystem.cpp

         if (!mStateCacheManager->activateGLTextureUnit(stage))
             return;
         
+#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
         bool hasCubeMapExt = mCurrentCapabilities->hasCapability(RSC_CUBEMAPPING);
+#endif
         
         switch(m)
         {
+#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
             case TEXCALC_NONE:
                 if(hasCubeMapExt)
                 {
                     GL_CHECK_ERROR
                 }
                 break;
-
+#endif
             case TEXCALC_ENVIRONMENT_MAP:
+#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
                 if(hasCubeMapExt)
                 {
                     glEnable(GL_TEXTURE_GEN_STR_OES);
                     glTexGeniOES( GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, GL_REFLECTION_MAP_OES );
                     GL_CHECK_ERROR
                 }
+#endif
                 mUseAutoTextureMatrix = true;
                 memset(mAutoTextureMatrix, 0, sizeof(GLfloat)*16);
                 mAutoTextureMatrix[0] = mAutoTextureMatrix[10] = mAutoTextureMatrix[15] = 1.0f;
                 break;
 
             case TEXCALC_ENVIRONMENT_MAP_REFLECTION:
+#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
                 if(hasCubeMapExt)
                 {
                     glEnable(GL_TEXTURE_GEN_STR_OES);
                     glTexGeniOES( GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, GL_REFLECTION_MAP_OES );
                     GL_CHECK_ERROR
                 }
+#endif
                 // We need an extra texture matrix here
                 // This sets the texture matrix to be the inverse of the view matrix
                 mUseAutoTextureMatrix = true;
                 mAutoTextureMatrix[15] = 1.0f;
                 break;
 
+#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
             case TEXCALC_ENVIRONMENT_MAP_NORMAL:
                 if(hasCubeMapExt)
                 {
                     GL_CHECK_ERROR
                 }
                 break;
-
+#endif
+                
             case TEXCALC_PROJECTIVE_TEXTURE:
                 mUseAutoTextureMatrix = true;