Skip to content

Commit

Permalink
OpenGL ES support for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gabomdq committed Nov 22, 2013
1 parent 45dbff2 commit 61959aa
Show file tree
Hide file tree
Showing 32 changed files with 6,741 additions and 1,210 deletions.
42 changes: 42 additions & 0 deletions README-windows.txt
@@ -0,0 +1,42 @@
================================================================================
Simple DirectMedia Layer for Windows
================================================================================

================================================================================
OpenGL ES 2.x support
================================================================================

SDL has support for OpenGL ES 2.x under Windows via two alternative
implementations.
The most straightforward method consists in running your app in a system with
a graphic card paired with a relatively recent (as of November of 2013) driver
which supports the WGL_EXT_create_context_es2_profile extension. Vendors known
to ship said extension on Windows currently include nVidia and Intel.

The other method involves using the ANGLE library (https://code.google.com/p/angleproject/)
If an OpenGL ES 2.x context is requested and no WGL_EXT_create_context_es2_profile
extension is found, SDL will try to load the libEGL.dll library provided by
ANGLE.
To obtain the ANGLE binaries, you can either compile from source from
https://chromium.googlesource.com/angle/angle or copy the relevant binaries from
a recent Chrome/Chromium install for Windows. The files you need are:

* libEGL.dll
* libGLESv2.dll
* d3dcompiler_46.dll (supports Windows Vista or later, better shader compiler)
or...
* d3dcompiler_43.dll (supports Windows XP or later)

If you compile ANGLE from source, you can configure it so it does not need the
d3dcompiler_* DLL at all (for details on this, see their documentation).
However, by default SDL will try to preload the d3dcompiler_46.dll to
comply with ANGLE's requirements. If you wish SDL to preload d3dcompiler_43.dll (to
support Windows XP) or to skip this step at all, you can use the
SDL_VIDEO_WIN_D3DCOMPILER hint (see SDL_hints.h for more details).

Known Bugs:

* SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears
that there's a bug in the library which prevents the window contents from
refreshing if this is set to anything other than the default value.

28 changes: 28 additions & 0 deletions VisualC/SDL/SDL_VS2008.vcproj
Expand Up @@ -415,6 +415,18 @@
RelativePath="..\..\include\SDL_cpuinfo.h"
>
</File>
<File
RelativePath="..\..\include\\SDL_egl.h"
>
</File>
<File
RelativePath="..\..\src\video\sdl_egl_c.h"
>
</File>
<File
RelativePath="..\..\src\video\windows\SDL_windowsopengles.h"
>
</File>
<File
RelativePath="..\..\include\SDL_endian.h"
>
Expand Down Expand Up @@ -1272,6 +1284,22 @@
RelativePath="..\..\src\video\windows\SDL_windowsopengl.c"
>
</File>
<File
RelativePath="..\..\src\render\opengles2\SDL_render_gles2.c"
>
</File>
<File
RelativePath="..\..\src\render\opengles2\SDL_shaders_gles2.c"
>
</File>
<File
RelativePath="..\..\src\video\SDL_egl.c"
>
</File>
<File
RelativePath="..\..\src\video\windows\SDL_windowsopengles.c"
>
</File>
<File
RelativePath="..\..\src\video\windows\SDL_windowsopengl.h"
>
Expand Down
7 changes: 7 additions & 0 deletions VisualC/SDL/SDL_VS2010.vcxproj
Expand Up @@ -553,6 +553,9 @@
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
<ClInclude Include="..\..\src\video\windows\wmmsg.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="..\..\include\SDL_egl.h" />
<ClInclude Include="..\..\src\video\sdl_egl_c.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengles.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
Expand Down Expand Up @@ -669,6 +672,10 @@
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\..\src\video\SDL_egl.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\main\windows\version.rc" />
Expand Down
7 changes: 7 additions & 0 deletions VisualC/SDL/SDL_VS2012.vcxproj
Expand Up @@ -344,6 +344,9 @@
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
<ClInclude Include="..\..\src\video\windows\wmmsg.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="..\..\include\SDL_egl.h" />
<ClInclude Include="..\..\src\video\sdl_egl_c.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengles.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
Expand Down Expand Up @@ -460,6 +463,10 @@
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\..\src\video\SDL_egl.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\main\windows\version.rc" />
Expand Down

0 comments on commit 61959aa

Please sign in to comment.