From b6f80d855eb00bfe70bf00b7026945edd81897f5 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Fri, 29 Nov 2013 00:19:46 -0500 Subject: [PATCH] WinRT: enable the OpenGL ES 2 SDL_Renderer backend, if and when OpenGL ES 2 support is compiled in --- VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj | 4 ++++ VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters | 12 ++++++++++++ include/SDL_config_winrt.h | 4 ++++ src/render/opengles2/SDL_render_gles2.c | 8 ++++++++ 4 files changed, 28 insertions(+) diff --git a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj index 8e9765fc6d5da..43bbb1a593554 100644 --- a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj +++ b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj @@ -104,6 +104,8 @@ true true + + @@ -284,6 +286,8 @@ + + diff --git a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters index 20f2f541c5ecf..b3c0686b4ece9 100644 --- a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters +++ b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters @@ -285,6 +285,12 @@ Source Files + + Source Files + + + Source Files + @@ -635,6 +641,12 @@ Header Files + + Source Files + + + Source Files + diff --git a/include/SDL_config_winrt.h b/include/SDL_config_winrt.h index 210d1e6607831..de09fbce73d5f 100644 --- a/include/SDL_config_winrt.h +++ b/include/SDL_config_winrt.h @@ -179,6 +179,10 @@ typedef unsigned int uintptr_t; /* Enable appropriate renderer(s) */ #define SDL_VIDEO_RENDER_D3D11 1 +#if SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif + /* Enable system power support */ // TODO, WinRT: investigate system power support. The Win32-based APIs don't work on WinRT. #define SDL_POWER_DISABLED 1 diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 31a1598c07dd8..2c0828a020263 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -1772,6 +1772,14 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) return NULL; } +#if __WINRT__ + /* DLudwig, 2013-11-29: ANGLE for WinRT doesn't seem to work unless VSync + * is turned on. Not doing so will freeze the screen's contents to that + * of the first drawn frame. + */ + flags |= SDL_RENDERER_PRESENTVSYNC; +#endif + if (flags & SDL_RENDERER_PRESENTVSYNC) { SDL_GL_SetSwapInterval(1); } else {