GLES2RICE: Update from upstream
[mupen64plus-pandora.git] / source / gles2rice / src / OGLGraphicsContext.cpp
old mode 100644 (file)
new mode 100755 (executable)
index ab394f1..09acac0
@@ -113,7 +113,11 @@ bool COGLGraphicsContext::Initialize(uint32 dwWidth, uint32 dwHeight, BOOL bWind
     /* Set the video mode */
     m64p_video_mode ScreenMode = bWindowed ? M64VIDEO_WINDOWED : M64VIDEO_FULLSCREEN;
     m64p_video_flags flags = M64VIDEOFLAG_SUPPORT_RESIZING;
+#if 1
+    if (CoreVideo_SetVideoMode(800, windowSetting.uDisplayHeight, colorBufferDepth, ScreenMode, flags) != M64ERR_SUCCESS)
+#else
     if (CoreVideo_SetVideoMode(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, colorBufferDepth, ScreenMode, flags) != M64ERR_SUCCESS)
+#endif
     {
         DebugMessage(M64MSG_ERROR, "Failed to set %i-bit video mode: %ix%i", colorBufferDepth, (int)windowSetting.uDisplayWidth, (int)windowSetting.uDisplayHeight);
         CoreVideo_Quit();
@@ -283,13 +287,14 @@ void COGLGraphicsContext::InitState(void)
     glDepthRange(-1, 1);
 
 #elif SDL_VIDEO_OPENGL_ES2
-    glDepthRangef(0.0f, 1.0f);
+    glDepthRangef(-1.0f, 1.0f);
 #endif
     OPENGL_CHECK_ERRORS;
 }
 
 void COGLGraphicsContext::InitOGLExtension(void)
 {
+#if SDL_VIDEO_OPENGL
     // important extension features, it is very bad not to have these feature
     m_bSupportMultiTexture = IsExtensionSupported(OSAL_GL_ARB_MULTITEXTURE);
     m_bSupportTextureEnvCombine = IsExtensionSupported("GL_EXT_texture_env_combine");
@@ -303,7 +308,11 @@ void COGLGraphicsContext::InitOGLExtension(void)
     m_bSupportRescaleNormal = IsExtensionSupported("GL_EXT_rescale_normal");
     m_bSupportLODBias = IsExtensionSupported("GL_EXT_texture_lod_bias");
     m_bSupportAnisotropicFiltering = IsExtensionSupported("GL_EXT_texture_filter_anisotropic");
-
+#else
+    m_bSupportMultiTexture = true;
+    m_bSupportFogCoord = true;
+    m_bSupportAnisotropicFiltering = true;
+#endif
     // Compute maxAnisotropicFiltering
     m_maxAnisotropicFiltering = 0;
 
@@ -327,7 +336,8 @@ void COGLGraphicsContext::InitOGLExtension(void)
         if((uint32) m_maxAnisotropicFiltering > options.anisotropicFiltering)
         m_maxAnisotropicFiltering = options.anisotropicFiltering;
     }
-
+       
+#if SDL_VIDEO_OPENGL
     // Nvidia only extension features (optional)
     m_bSupportNVRegisterCombiner = IsExtensionSupported("GL_NV_register_combiners");
     m_bSupportTextureMirrorRepeat = IsExtensionSupported("GL_IBM_texture_mirrored_repeat") || IsExtensionSupported("ARB_texture_mirrored_repeat");
@@ -336,7 +346,9 @@ void COGLGraphicsContext::InitOGLExtension(void)
     m_bSupportBlendColor = IsExtensionSupported("GL_EXT_blend_color");
     m_bSupportBlendSubtract = IsExtensionSupported("GL_EXT_blend_subtract");
     m_bSupportNVTextureEnvCombine4 = IsExtensionSupported("GL_NV_texture_env_combine4");
-
+#else
+    m_supportTextureMirror = true;
+#endif
 }
 
 bool COGLGraphicsContext::IsExtensionSupported(const char* pExtName)