Browse Source

Use orientation hint only on iOS.
Do not reserve a stencil buffer on OpenGL ES.

Lasse Öörni 13 years ago
parent
commit
ddc93f6fd2
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Engine/Graphics/OpenGL/OGLGraphics.cpp

+ 7 - 0
Engine/Graphics/OpenGL/OGLGraphics.cpp

@@ -230,14 +230,21 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool vsync, bool
         // SDL window parameters are static, so need to operate under static lock
         // SDL window parameters are static, so need to operate under static lock
         MutexLock lock(GetStaticMutex());
         MutexLock lock(GetStaticMutex());
         
         
+        #ifdef IOS
         SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");
         SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");
+        #endif
+        
         SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
         SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
         SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
         SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
         SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
         SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
         SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
         SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
         SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
         SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
         SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
         SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
+        #ifndef GL_ES_VERSION_2_0
         SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
         SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
+        #else
+        SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 0);
+        #endif
         SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
         SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
         SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
         SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);