Przeglądaj źródła

Added windows tweak so both opengl + gles20 contexts are available.

Mark Sibly 9 lat temu
rodzic
commit
a434c4a678

+ 2 - 0
modules/sdl2/SDL/MARKS_FIXES.TXt

@@ -1,6 +1,8 @@
 
 
 * SDL_windowsopengles.c - enabled SwapInterval.
 * SDL_windowsopengles.c - enabled SwapInterval.
 
 
+* SDL_windowsopengl.c - Disabled "_this->gl_data->HAS_WGL_EXT_create_context_es2_profile = SDL_TRUE;" so angle always used for gles20.
+
 * SDL_events.c - used semaphore for WaitEvent instead SDL_Delay( 10 )!
 * SDL_events.c - used semaphore for WaitEvent instead SDL_Delay( 10 )!
 
 
 * SDL_timer.c - fixed 'slippage' bug.
 * SDL_timer.c - fixed 'slippage' bug.

+ 4 - 1
modules/sdl2/SDL/include/SDL_config_macosx.h

@@ -132,10 +132,13 @@
 #define SDL_VIDEO_DRIVER_DUMMY  1
 #define SDL_VIDEO_DRIVER_DUMMY  1
 #define SDL_VIDEO_DRIVER_COCOA  1
 #define SDL_VIDEO_DRIVER_COCOA  1
 
 
+//#define SDL_RENDER_DISABLED 1
+
 /* Enable OpenGL support */
 /* Enable OpenGL support */
 #define SDL_VIDEO_OPENGL    1
 #define SDL_VIDEO_OPENGL    1
 #define SDL_VIDEO_OPENGL_CGL    1
 #define SDL_VIDEO_OPENGL_CGL    1
-#define SDL_VIDEO_RENDER_OGL    1
+
+#define SDL_VIDEO_RENDER_OGL    0
 
 
 /* Enable system power support */
 /* Enable system power support */
 #define SDL_POWER_MACOSX 1
 #define SDL_POWER_MACOSX 1

+ 6 - 6
modules/sdl2/SDL/include/SDL_config_windows.h

@@ -187,15 +187,18 @@ typedef unsigned int uintptr_t;
 #define SDL_VIDEO_OPENGL_EGL    1
 #define SDL_VIDEO_OPENGL_EGL    1
 #endif
 #endif
 #ifndef SDL_VIDEO_OPENGL
 #ifndef SDL_VIDEO_OPENGL
-#define SDL_VIDEO_OPENGL    	0
+#define SDL_VIDEO_OPENGL    	1
 #endif
 #endif
 #ifndef SDL_VIDEO_OPENGL_WGL
 #ifndef SDL_VIDEO_OPENGL_WGL
-#define SDL_VIDEO_OPENGL_WGL    0
+#define SDL_VIDEO_OPENGL_WGL    1
 #endif
 #endif
 
 
 /* Render support */
 /* Render support */
 #ifndef SDL_VIDEO_RENDER_OGL_ES2
 #ifndef SDL_VIDEO_RENDER_OGL_ES2
-#define SDL_VIDEO_RENDER_OGL_ES2    1
+#define SDL_VIDEO_RENDER_OGL_ES2    0
+#endif
+#ifndef SDL_VIDEO_RENDER_OGL
+#define SDL_VIDEO_RENDER_OGL    0
 #endif
 #endif
 #ifndef SDL_VIDEO_RENDER_D3D
 #ifndef SDL_VIDEO_RENDER_D3D
 #define SDL_VIDEO_RENDER_D3D    0
 #define SDL_VIDEO_RENDER_D3D    0
@@ -203,9 +206,6 @@ typedef unsigned int uintptr_t;
 #ifndef SDL_VIDEO_RENDER_D3D11
 #ifndef SDL_VIDEO_RENDER_D3D11
 #define SDL_VIDEO_RENDER_D3D11	0
 #define SDL_VIDEO_RENDER_D3D11	0
 #endif
 #endif
-#ifndef SDL_VIDEO_RENDER_OGL
-#define SDL_VIDEO_RENDER_OGL    0
-#endif
 
 
 /* Enable system power support */
 /* Enable system power support */
 #define SDL_POWER_WINDOWS 1
 #define SDL_POWER_WINDOWS 1

+ 10 - 2
modules/sdl2/SDL/src/video/windows/SDL_windowsopengl.c

@@ -405,11 +405,17 @@ WIN_GL_InitExtensions(_THIS)
         _this->gl_data->wglSwapIntervalEXT = NULL;
         _this->gl_data->wglSwapIntervalEXT = NULL;
         _this->gl_data->wglGetSwapIntervalEXT = NULL;
         _this->gl_data->wglGetSwapIntervalEXT = NULL;
     }
     }
-
+    
     /* Check for WGL_EXT_create_context_es2_profile */
     /* Check for WGL_EXT_create_context_es2_profile */
     _this->gl_data->HAS_WGL_EXT_create_context_es2_profile = SDL_FALSE;
     _this->gl_data->HAS_WGL_EXT_create_context_es2_profile = SDL_FALSE;
     if (HasExtension("WGL_EXT_create_context_es2_profile", extensions)) {
     if (HasExtension("WGL_EXT_create_context_es2_profile", extensions)) {
-        _this->gl_data->HAS_WGL_EXT_create_context_es2_profile = SDL_TRUE;
+    
+    
+		// MARK WAS HERE!!!!
+		// Disabled this so angle is ALWAYS used for gles20.
+		//
+		// _this->gl_data->HAS_WGL_EXT_create_context_es2_profile = SDL_TRUE;
+		
     }
     }
 
 
     /* Check for GLX_ARB_context_flush_control */
     /* Check for GLX_ARB_context_flush_control */
@@ -593,6 +599,8 @@ WIN_GL_SetupWindow(_THIS, SDL_Window * window)
     return retval;
     return retval;
 }
 }
 
 
+#include <stdio.h>
+
 SDL_GLContext
 SDL_GLContext
 WIN_GL_CreateContext(_THIS, SDL_Window * window)
 WIN_GL_CreateContext(_THIS, SDL_Window * window)
 {
 {