WinRT: enable the OpenGL ES 2 SDL_Renderer backend, if and when OpenGL ES 2 support is compiled in
authorDavid Ludwig <dludwig@pobox.com>
Fri, 29 Nov 2013 00:19:46 -0500
changeset 8546b09dc0606036
parent 8545 7cf4f8916997
child 8547 9d65f568c6b9
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
VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters
include/SDL_config_winrt.h
src/render/opengles2/SDL_render_gles2.c
     1.1 --- a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj	Thu Nov 28 22:59:21 2013 -0500
     1.2 +++ b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj	Fri Nov 29 00:19:46 2013 -0500
     1.3 @@ -104,6 +104,8 @@
     1.4        <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</CompileAsWinRT>
     1.5        <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</CompileAsWinRT>
     1.6      </ClCompile>
     1.7 +    <ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
     1.8 +    <ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
     1.9      <ClCompile Include="..\..\src\render\SDL_render.c" />
    1.10      <ClCompile Include="..\..\src\render\SDL_yuv_mmx.c" />
    1.11      <ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
    1.12 @@ -284,6 +286,8 @@
    1.13      <ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
    1.14      <ClInclude Include="..\..\src\render\direct3d11\SDL_render_d3d11_cpp.h" />
    1.15      <ClInclude Include="..\..\src\render\mmx.h" />
    1.16 +    <ClInclude Include="..\..\src\render\opengles2\SDL_gles2funcs.h" />
    1.17 +    <ClInclude Include="..\..\src\render\opengles2\SDL_shaders_gles2.h" />
    1.18      <ClInclude Include="..\..\src\render\SDL_sysrender.h" />
    1.19      <ClInclude Include="..\..\src\render\SDL_yuv_sw_c.h" />
    1.20      <ClInclude Include="..\..\src\render\software\SDL_blendfillrect.h" />
     2.1 --- a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters	Thu Nov 28 22:59:21 2013 -0500
     2.2 +++ b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters	Fri Nov 29 00:19:46 2013 -0500
     2.3 @@ -285,6 +285,12 @@
     2.4      <ClCompile Include="..\..\src\video\winrt\SDL_winrtopengles.cpp">
     2.5        <Filter>Source Files</Filter>
     2.6      </ClCompile>
     2.7 +    <ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c">
     2.8 +      <Filter>Source Files</Filter>
     2.9 +    </ClCompile>
    2.10 +    <ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c">
    2.11 +      <Filter>Source Files</Filter>
    2.12 +    </ClCompile>
    2.13    </ItemGroup>
    2.14    <ItemGroup>
    2.15      <ClInclude Include="..\..\include\begin_code.h">
    2.16 @@ -635,6 +641,12 @@
    2.17      <ClInclude Include="..\..\include\SDL_egl.h">
    2.18        <Filter>Header Files</Filter>
    2.19      </ClInclude>
    2.20 +    <ClInclude Include="..\..\src\render\opengles2\SDL_gles2funcs.h">
    2.21 +      <Filter>Source Files</Filter>
    2.22 +    </ClInclude>
    2.23 +    <ClInclude Include="..\..\src\render\opengles2\SDL_shaders_gles2.h">
    2.24 +      <Filter>Source Files</Filter>
    2.25 +    </ClInclude>
    2.26    </ItemGroup>
    2.27    <ItemGroup>
    2.28      <Filter Include="Header Files">
     3.1 --- a/include/SDL_config_winrt.h	Thu Nov 28 22:59:21 2013 -0500
     3.2 +++ b/include/SDL_config_winrt.h	Fri Nov 29 00:19:46 2013 -0500
     3.3 @@ -179,6 +179,10 @@
     3.4  /* Enable appropriate renderer(s) */
     3.5  #define SDL_VIDEO_RENDER_D3D11  1
     3.6  
     3.7 +#if SDL_VIDEO_OPENGL_ES2
     3.8 +#define SDL_VIDEO_RENDER_OGL_ES2 1
     3.9 +#endif
    3.10 +
    3.11  /* Enable system power support */
    3.12  // TODO, WinRT: investigate system power support.  The Win32-based APIs don't work on WinRT.
    3.13  #define SDL_POWER_DISABLED  1
     4.1 --- a/src/render/opengles2/SDL_render_gles2.c	Thu Nov 28 22:59:21 2013 -0500
     4.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Fri Nov 29 00:19:46 2013 -0500
     4.3 @@ -1772,6 +1772,14 @@
     4.4          return NULL;
     4.5      }
     4.6  
     4.7 +#if __WINRT__
     4.8 +    /* DLudwig, 2013-11-29: ANGLE for WinRT doesn't seem to work unless VSync
     4.9 +     * is turned on.  Not doing so will freeze the screen's contents to that
    4.10 +     * of the first drawn frame.
    4.11 +     */
    4.12 +    flags |= SDL_RENDERER_PRESENTVSYNC;
    4.13 +#endif
    4.14 +
    4.15      if (flags & SDL_RENDERER_PRESENTVSYNC) {
    4.16          SDL_GL_SetSwapInterval(1);
    4.17      } else {