We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2088

Summary: SDL 2.0 does not support OpenGL ES 2.0 on windows
Product: SDL Reporter: Sergey Kurdakov <kurdakov>
Component: videoAssignee: Gabriel Jacobo <gabomdq>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: BurnSpamAddress
Version: 2.0.0   
Hardware: x86_64   
OS: Windows 8   
Attachments: OpenGL ES support for Windows using ANGLE
OpenGL ES support for Windows using ANGLE

Description Sergey Kurdakov 2013-09-05 13:33:07 UTC
SDL 2.0 can be compiled with 

#ifndef SDL_VIDEO_OPENGL_ES2
#define SDL_VIDEO_OPENGL_ES2    1
#endif

but no egl functions will be invoked.

prior to common EGL sdl 2.0 way to add OpenGL ES 2.0 support using ANGLE project  there is an example 
  https://github.com/fantasydr/sdl-gles 

the files which are relevant for reference are 


SDL_windowswindow.c SDL_windowsopengl.c
SDL_windowsopengles.c SDL_windowsopengles.h

in src\video\windows folder.
Comment 1 Gabriel Jacobo 2013-11-09 11:44:35 UTC
*** Bug 2222 has been marked as a duplicate of this bug. ***
Comment 2 Gabriel Jacobo 2013-11-13 14:58:14 UTC
Sam, I've been working on this. In order for this to work semi sanely in Visual Studio, we need to ship, at least, the EGL and OpenGL ES2 headers in SDL like we do in SDL_opengl.h, otherwise we start having a build time dependency on Angle. Does that sound like a good compromise?
Comment 3 Sam Lantinga 2013-11-15 06:11:34 UTC
Yup, sounds good. :)
Comment 4 Gabriel Jacobo 2013-11-20 23:53:41 UTC
Created attachment 1462 [details]
OpenGL ES support for Windows using ANGLE

Attached is a first pass at achieving this. To test, you need the ANGLE binaries, which you can obtain from any Chrome install (libEGL.dll, libGLESv2.dll, and d3dcompiler_46.dll)

Three main remaining items:

- testgles2 does not actually work in my system (it displays the first frame and does not update the window)
- Loading d3dcompiler_46.dll should be driven by a hint, given that you can also load d3dcompiler_43.dll to better support XP, or not load it at all if you roll a hand built version of ANGLE which includes their compiler.
- README explaining caveats (all of the above, plus how to install Angle, how to obtain it, etc)
Comment 5 Gabriel Jacobo 2013-11-22 00:47:58 UTC
Created attachment 1464 [details]
OpenGL ES support for Windows using ANGLE

Attaching final version!
Comment 6 Gabriel Jacobo 2013-11-22 17:20:35 UTC
Fixed: https://hg.libsdl.org/SDL/rev/f96e12e0ade9