author Sam Lantinga
Tue, 10 Jan 2017 08:54:33 -0800
changeset 10806 36f40b8cc979
parent 10737 3406a0f8b041
permissions -rwxr-xr-x
Fixed bugs 2570, 3145, improved OpenGL ES context support on Windows and X11

Mark Callow

The attached patch does the following for the X11 and Windows platforms, the only ones where SDL attempts to use context_create_es_profile:

- Adds SDL_HINT_OPENGL_ES_DRIVER by which the application can
say to use the OpenGL ES driver & EGL rather than the Open GL
driver. (For bug #2570)
- Adds code to {WIN,X11}_GL_InitExtensions to determine the maximum
OpenGL ES version supported by the OpenGL driver (for bug #3145)
- Modifies the test that determines whether to use the OpenGL
driver or the real OpenGL ES driver to take into account the
hint, the requested and supported ES version and whether ES 1.X
is being requested. (For bug #2570 & bug #3145)
- Enables the testgles2 test for __WINDOWS__ and __LINUX__ and adds
the test to the VisualC projects.

With the fix in place I have run testdraw2, testgl and testgles2 without any issues and have run my own apps that use OpenGL, OpenGL ES 3 and OpenGL ES 1.1.
     1 Visual and Interactive Test Automation for SDL 2.0
     2 Copyright (C) 2013 Apoorv Upreti <>
     4 This software is provided 'as-is', without any express or implied
     5 warranty.  In no event will the authors be held liable for any damages
     6 arising from the use of this software.
     8 Permission is granted to anyone to use this software for any purpose,
     9 including commercial applications, and to alter it and redistribute it
    10 freely, subject to the following restrictions:
    12 1. The origin of this software must not be misrepresented; you must not
    13    claim that you wrote the original software. If you use this software
    14    in a product, an acknowledgment in the product documentation would be
    15    appreciated but is not required.
    16 2. Altered source versions must be plainly marked as such, and must not be
    17    misrepresented as being the original software.
    18 3. This notice may not be removed or altered from any source distribution.