21 #include "../SDL_internal.h"
23 #if SDL_VIDEO_OPENGL_EGL
25 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
26 #include "../core/windows/SDL_windows.h"
28 #if SDL_VIDEO_DRIVER_ANDROID
29 #include <android/native_window.h>
30 #include "../core/android/SDL_android.h"
38 #ifdef EGL_KHR_create_context
40 #ifndef EGL_OPENGL_ES3_BIT_KHR
41 #define EGL_OPENGL_ES3_BIT_KHR 0x00000040
45 #if SDL_VIDEO_DRIVER_RPI
47 #define DEFAULT_EGL ( vc4 ? "libEGL.so.1" : "libbrcmEGL.so" )
48 #define DEFAULT_OGL_ES2 ( vc4 ? "libGLESv2.so.2" : "libbrcmGLESv2.so" )
49 #define ALT_EGL "libEGL.so"
50 #define ALT_OGL_ES2 "libGLESv2.so"
51 #define DEFAULT_OGL_ES_PVR ( vc4 ? "libGLES_CM.so.1" : "libbrcmGLESv2.so" )
52 #define DEFAULT_OGL_ES ( vc4 ? "libGLESv1_CM.so.1" : "libbrcmGLESv2.so" )
54 #elif SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_VIVANTE
56 #define DEFAULT_EGL "libEGL.so"
57 #define DEFAULT_OGL_ES2 "libGLESv2.so"
58 #define DEFAULT_OGL_ES_PVR "libGLES_CM.so"
59 #define DEFAULT_OGL_ES "libGLESv1_CM.so"
61 #elif SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
63 #define DEFAULT_EGL "libEGL.dll"
64 #define DEFAULT_OGL_ES2 "libGLESv2.dll"
65 #define DEFAULT_OGL_ES_PVR "libGLES_CM.dll"
66 #define DEFAULT_OGL_ES "libGLESv1_CM.dll"
68 #elif SDL_VIDEO_DRIVER_COCOA
70 #define DEFAULT_EGL "libEGL.dylib"
71 #define DEFAULT_OGL_ES2 "libGLESv2.dylib"
72 #define DEFAULT_OGL_ES_PVR "libGLES_CM.dylib"
73 #define DEFAULT_OGL_ES "libGLESv1_CM.dylib"
75 #elif defined(__OpenBSD__)
76 #define DEFAULT_OGL "libGL.so"
77 #define DEFAULT_EGL "libEGL.so"
78 #define DEFAULT_OGL_ES2 "libGLESv2.so"
79 #define DEFAULT_OGL_ES_PVR "libGLES_CM.so"
80 #define DEFAULT_OGL_ES "libGLESv1_CM.so"
84 #define DEFAULT_OGL "libGL.so.1"
85 #define DEFAULT_EGL "libEGL.so.1"
86 #define DEFAULT_OGL_ES2 "libGLESv2.so.2"
87 #define DEFAULT_OGL_ES_PVR "libGLES_CM.so.1"
88 #define DEFAULT_OGL_ES "libGLESv1_CM.so.1"
98 #ifndef EGL_PLATFORM_DEVICE_EXT
99 #define EGL_PLATFORM_DEVICE_EXT 0x0
102 #ifdef SDL_VIDEO_STATIC_ANGLE
103 #define LOAD_FUNC(NAME) \
104 _this->egl_data->NAME = (void *)NAME;
106 #define LOAD_FUNC(NAME) \
107 _this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
108 if (!_this->egl_data->NAME) \
110 return SDL_SetError("Could not retrieve EGL function " #NAME); \
115 #define LOAD_FUNC_EGLEXT(NAME) \
116 _this->egl_data->NAME = _this->egl_data->eglGetProcAddress(#NAME);
119 static const char * SDL_EGL_GetErrorName(
EGLint eglErrorCode)
121 #define SDL_EGL_ERROR_TRANSLATE(e) case e: return #e;
122 switch (eglErrorCode) {
142 int SDL_EGL_SetErrorEx(
const char *
message,
const char * eglFunctionName,
EGLint eglErrorCode)
144 const char * errorText = SDL_EGL_GetErrorName(eglErrorCode);
145 char altErrorText[32];
146 if (errorText[0] ==
'\0') {
149 errorText = altErrorText;
151 return SDL_SetError(
"%s (call to %s failed, reporting an error of %s)",
message, eglFunctionName, errorText);
156 SDL_bool SDL_EGL_HasExtension(
_THIS, SDL_EGL_ExtensionType
type,
const char *ext)
159 const char *ext_override;
160 const char *egl_extstr;
161 const char *ext_start;
177 if (ext_override !=
NULL) {
178 int disable_ext =
SDL_atoi(ext_override);
179 if (disable_ext & 0x01 &&
type == SDL_EGL_DISPLAY_EXTENSION) {
181 }
else if (disable_ext & 0x02 &&
type == SDL_EGL_CLIENT_EXTENSION) {
188 case SDL_EGL_DISPLAY_EXTENSION:
191 case SDL_EGL_CLIENT_EXTENSION:
203 if (egl_extstr !=
NULL) {
204 ext_start = egl_extstr;
208 if (ext_start ==
NULL) {
212 if (ext_start == egl_extstr || *(ext_start - 1) ==
' ') {
213 if (ext_start[ext_len] ==
' ' || ext_start[ext_len] == 0) {
218 ext_start += ext_len;
219 while (*ext_start !=
' ' && *ext_start != 0) {
229 SDL_EGL_GetProcAddress(
_THIS,
const char *proc)
232 const SDL_bool is_egl_15_or_later = eglver >= ((((
Uint32) 1) << 16) | 5);
236 if (!
retval && is_egl_15_or_later &&
_this->egl_data->eglGetProcAddress) {
240 #ifndef __EMSCRIPTEN__
243 static char procname[64];
248 SDL_strlcpy(procname + 1, proc,
sizeof (procname) - 1);
255 if (!
retval && !is_egl_15_or_later &&
_this->egl_data->eglGetProcAddress) {
266 SDL_EGL_UnloadLibrary(
_THIS)
268 if (
_this->egl_data) {
269 if (
_this->egl_data->egl_display) {
270 _this->egl_data->eglTerminate(
_this->egl_data->egl_display);
278 if (
_this->egl_data->egl_dll_handle) {
289 SDL_EGL_LoadLibraryOnly(
_THIS,
const char *egl_path)
291 void *dll_handle =
NULL, *egl_dll_handle =
NULL;
293 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
294 const char *d3dcompiler;
296 #if SDL_VIDEO_DRIVER_RPI
300 if (
_this->egl_data) {
304 _this->egl_data = (
struct SDL_EGL_VideoData *)
SDL_calloc(1,
sizeof(SDL_EGL_VideoData));
305 if (!
_this->egl_data) {
309 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
320 const char *d3dcompiler_list[] = {
321 "d3dcompiler_47.dll",
"d3dcompiler_46.dll",
339 #ifndef SDL_VIDEO_STATIC_ANGLE
346 if (egl_dll_handle ==
NULL) {
349 path = DEFAULT_OGL_ES2;
352 if (egl_dll_handle ==
NULL && !vc4) {
359 path = DEFAULT_OGL_ES;
361 if (egl_dll_handle ==
NULL) {
362 path = DEFAULT_OGL_ES_PVR;
366 if (egl_dll_handle ==
NULL && !vc4) {
380 _this->egl_data->egl_dll_handle = egl_dll_handle;
382 if (egl_dll_handle ==
NULL) {
383 return SDL_SetError(
"Could not initialize OpenGL / GLES library");
387 if (egl_path !=
NULL) {
392 if (dll_handle !=
NULL) {
402 if (dll_handle ==
NULL && !vc4) {
409 if (dll_handle !=
NULL) {
441 LOAD_FUNC_EGLEXT(eglQueryDevicesEXT);
442 LOAD_FUNC_EGLEXT(eglGetPlatformDisplayEXT);
444 LOAD_FUNC_EGLEXT(eglCreateSyncKHR);
445 LOAD_FUNC_EGLEXT(eglDestroySyncKHR);
446 LOAD_FUNC_EGLEXT(eglDupNativeFenceFDANDROID);
447 LOAD_FUNC_EGLEXT(eglWaitSyncKHR);
448 LOAD_FUNC_EGLEXT(eglClientWaitSyncKHR);
461 SDL_EGL_GetVersion(
_THIS) {
462 if (
_this->egl_data->eglQueryString) {
463 const char *egl_version =
_this->egl_data->eglQueryString(
_this->egl_data->egl_display,
EGL_VERSION);
465 int major = 0, minor = 0;
466 if (
SDL_sscanf(egl_version,
"%d.%d", &major, &minor) == 2) {
467 _this->egl_data->egl_version_major = major;
468 _this->egl_data->egl_version_minor = minor;
479 int egl_version_major, egl_version_minor;
480 int library_load_retcode = SDL_EGL_LoadLibraryOnly(
_this, egl_path);
481 if (library_load_retcode != 0) {
482 return library_load_retcode;
486 SDL_EGL_GetVersion(
_this);
488 egl_version_major =
_this->egl_data->egl_version_major;
489 egl_version_minor =
_this->egl_data->egl_version_minor;
491 if (egl_version_major == 1 && egl_version_minor == 5) {
496 #if !defined(__WINRT__)
498 if (egl_version_major == 1 && egl_version_minor == 5) {
501 if (SDL_EGL_HasExtension(
_this, SDL_EGL_CLIENT_EXTENSION,
"EGL_EXT_platform_base")) {
502 _this->egl_data->eglGetPlatformDisplayEXT = SDL_EGL_GetProcAddress(
_this,
"eglGetPlatformDisplayEXT");
503 if (
_this->egl_data->eglGetPlatformDisplayEXT) {
527 SDL_EGL_GetVersion(
_this);
529 _this->egl_data->is_offscreen = 0;
545 void *egl_devices[SDL_EGL_MAX_DEVICES];
546 EGLint num_egl_devices = 0;
547 const char *egl_device_hint;
550 return SDL_SetError(
"SDL_EGL_LoadLibraryOnly() has not been called or has failed.");
554 if (
_this->egl_data->eglQueryDevicesEXT ==
NULL) {
555 return SDL_SetError(
"eglQueryDevicesEXT is missing (EXT_device_enumeration not supported by the drivers?)");
558 if (
_this->egl_data->eglGetPlatformDisplayEXT ==
NULL) {
559 return SDL_SetError(
"eglGetPlatformDisplayEXT is missing (EXT_platform_base not supported by the drivers?)");
562 if (
_this->egl_data->eglQueryDevicesEXT(SDL_EGL_MAX_DEVICES, egl_devices, &num_egl_devices) !=
EGL_TRUE) {
566 egl_device_hint =
SDL_GetHint(
"SDL_HINT_EGL_DEVICE");
567 if (egl_device_hint) {
570 if (
device >= num_egl_devices) {
571 return SDL_SetError(
"Invalid EGL device is requested.");
577 return SDL_SetError(
"eglGetPlatformDisplayEXT() failed.");
590 for (
i = 0;
i < num_egl_devices;
i++) {
598 _this->egl_data->eglTerminate(attempted_egl_display);
603 _this->egl_data->egl_display = attempted_egl_display;
610 return SDL_SetError(
"Could not find a valid EGL device to initialize");
615 SDL_EGL_GetVersion(
_this);
617 _this->egl_data->is_offscreen = 1;
623 SDL_EGL_SetRequiredVisualId(
_THIS,
int visual_id)
625 _this->egl_data->egl_required_visual_id=visual_id;
628 #ifdef DUMP_EGL_CONFIG
630 #define ATTRIBUTE(_attr) { _attr, #_attr }
637 Attribute attributes[] = {
677 for (attr = 0 ; attr<
sizeof(attributes)/
sizeof(Attribute) ; attr++) {
679 _this->egl_data->eglGetConfigAttrib(
_this->egl_data->egl_display,
config, attributes[attr].attribute, &
value);
687 SDL_EGL_ChooseConfig(
_THIS)
695 int i,
j, best_bitdiff = -1, bitdiff;
697 if (!
_this->egl_data) {
739 if (
_this->egl_data->is_offscreen) {
746 #ifdef EGL_KHR_create_context
748 SDL_EGL_HasExtension(
_this, SDL_EGL_DISPLAY_EXTENSION,
"EGL_KHR_create_context")) {
763 if (
_this->egl_data->egl_surfacetype) {
770 if (
_this->egl_data->eglChooseConfig(
_this->egl_data->egl_display,
774 found_configs == 0) {
775 return SDL_EGL_SetError(
"Couldn't find matching EGL config",
"eglChooseConfig");
779 for (
i = 0;
i < found_configs;
i++ ) {
780 if (
_this->egl_data->egl_required_visual_id)
783 _this->egl_data->eglGetConfigAttrib(
_this->egl_data->egl_display,
786 if (
_this->egl_data->egl_required_visual_id ==
format)
794 for (
i = 0;
i < found_configs;
i++ ) {
795 if (has_matching_format &&
_this->egl_data->egl_required_visual_id)
798 _this->egl_data->eglGetConfigAttrib(
_this->egl_data->egl_display,
801 if (
_this->egl_data->egl_required_visual_id !=
format)
823 if (bitdiff < best_bitdiff || best_bitdiff == -1) {
824 _this->egl_data->egl_config = configs[
i];
826 best_bitdiff = bitdiff;
834 #ifdef DUMP_EGL_CONFIG
835 dumpconfig(
_this,
_this->egl_data->egl_config);
854 if (!
_this->egl_data) {
863 #if SDL_VIDEO_DRIVER_ANDROID
871 int egl_version_major =
_this->egl_data->egl_version_major;
872 int egl_version_minor =
_this->egl_data->egl_version_minor;
873 if (((egl_version_major < 1) || (egl_version_major == 1 && egl_version_minor < 5)) &&
874 !SDL_EGL_HasExtension(
_this, SDL_EGL_DISPLAY_EXTENSION,
"EGL_KHR_debug")) {
882 if ((major_version < 3 || (minor_version == 0 && profile_es)) &&
884 (profile_mask == 0 || profile_es)) {
896 #ifdef EGL_KHR_create_context
900 if (SDL_EGL_HasExtension(
_this, SDL_EGL_DISPLAY_EXTENSION,
"EGL_KHR_create_context")) {
902 attribs[attr++] = major_version;
904 attribs[attr++] = minor_version;
909 attribs[attr++] = profile_mask;
920 SDL_SetError(
"Could not create EGL context (context attributes are not supported)");
926 #ifdef EGL_KHR_create_context_no_error
927 if (SDL_EGL_HasExtension(
_this, SDL_EGL_DISPLAY_EXTENSION,
"EGL_KHR_create_context_no_error")) {
933 SDL_SetError(
"EGL implementation does not support no_error contexts");
947 egl_context =
_this->egl_data->eglCreateContext(
_this->egl_data->egl_display,
948 _this->egl_data->egl_config,
952 SDL_EGL_SetError(
"Could not create EGL context",
"eglCreateContext");
956 _this->egl_data->egl_swapinterval = 0;
958 if (SDL_EGL_MakeCurrent(
_this, egl_surface, egl_context) < 0) {
960 char errorText[1024];
964 SDL_EGL_DeleteContext(
_this, egl_context);
975 if ((
_this->egl_data->egl_version_major > 1) ||
976 ((
_this->egl_data->egl_version_major == 1) && (
_this->egl_data->egl_version_minor >= 5)) ||
977 SDL_EGL_HasExtension(
_this, SDL_EGL_DISPLAY_EXTENSION,
"EGL_KHR_surfaceless_context"))
991 if (glGetIntegervFunc) {
1010 if (!
_this->egl_data) {
1020 if (!
_this->egl_data->eglMakeCurrent(
_this->egl_data->egl_display,
1021 egl_surface, egl_surface, egl_context)) {
1022 return SDL_EGL_SetError(
"Unable to make EGL context current",
"eglMakeCurrent");
1030 SDL_EGL_SetSwapInterval(
_THIS,
int interval)
1034 if (!
_this->egl_data) {
1038 status =
_this->egl_data->eglSwapInterval(
_this->egl_data->egl_display, interval);
1040 _this->egl_data->egl_swapinterval = interval;
1044 return SDL_EGL_SetError(
"Unable to set the EGL swap interval",
"eglSwapInterval");
1048 SDL_EGL_GetSwapInterval(
_THIS)
1050 if (!
_this->egl_data) {
1055 return _this->egl_data->egl_swapinterval;
1061 if (!
_this->egl_data->eglSwapBuffers(
_this->egl_data->egl_display, egl_surface)) {
1062 return SDL_EGL_SetError(
"unable to show color buffer in an OS-native window",
"eglSwapBuffers");
1073 if (!
_this->egl_data) {
1078 _this->egl_data->eglDestroyContext(
_this->egl_data->egl_display, egl_context);
1092 if (SDL_EGL_ChooseConfig(
_this) != 0) {
1096 #if SDL_VIDEO_DRIVER_ANDROID
1102 _this->egl_data->eglGetConfigAttrib(
_this->egl_data->egl_display,
1103 _this->egl_data->egl_config,
1106 ANativeWindow_setBuffersGeometry(nw, 0, 0,
format);
1114 #ifdef EGL_KHR_gl_colorspace
1115 if (SDL_EGL_HasExtension(
_this, SDL_EGL_DISPLAY_EXTENSION,
"EGL_KHR_gl_colorspace")) {
1121 SDL_SetError(
"EGL implementation does not support sRGB system framebuffers");
1129 _this->egl_data->egl_display,
1130 _this->egl_data->egl_config,
1133 SDL_EGL_SetError(
"unable to create an EGL window surface",
"eglCreateWindowSurface");
1147 if (SDL_EGL_ChooseConfig(
_this) != 0) {
1151 return _this->egl_data->eglCreatePbufferSurface(
1152 _this->egl_data->egl_display,
1153 _this->egl_data->egl_config,
1160 if (!
_this->egl_data) {
1165 _this->egl_data->eglDestroySurface(
_this->egl_data->egl_display, egl_surface);
void Android_JNI_SetSurfaceViewFormat(int format)
#define SDL_GL_GetProcAddress
#define SDL_GL_ExtensionSupported
#define SDL_GL_GetCurrentContext
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
#define SDL_OutOfMemory()
#define SDL_HINT_VIDEO_WIN_D3DCOMPILER
A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries.
void * SDL_LoadFunction(void *handle, const char *name)
GLint GLint GLsizei width
GLint GLint GLsizei GLsizei height
GLuint GLuint GLsizei GLenum type
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLuint GLsizei const GLchar * message
GLuint const GLchar * name
GLuint GLint GLboolean GLint GLenum access
GLsizei const GLchar *const * path
GLsizei const GLfloat * value
#define SDL_arraysize(array)
static SDL_VideoDevice * _this
@ SDL_GL_CONTEXT_DEBUG_FLAG
void * SDL_GLContext
An opaque handle to an OpenGL context.
@ SDL_GL_CONTEXT_PROFILE_ES
BOOL WIN_IsWindowsVistaOrGreater(void)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
#define EGL_BAD_NATIVE_PIXMAP
#define EGL_MAX_PBUFFER_WIDTH
#define EGL_BIND_TO_TEXTURE_RGBA
#define EGL_OPENGL_ES_BIT
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
#define EGL_NATIVE_VISUAL_ID
#define EGL_CONFIG_CAVEAT
#define EGL_RENDERABLE_TYPE
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void)
#define EGL_LUMINANCE_SIZE
#define EGL_NATIVE_RENDERABLE
#define EGL_TRANSPARENT_RED_VALUE
#define EGL_TRANSPARENT_BLUE_VALUE
#define EGL_BAD_PARAMETER
#define EGL_TRANSPARENT_GREEN_VALUE
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
#define EGL_MAX_SWAP_INTERVAL
#define EGL_SAMPLE_BUFFERS
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
#define EGL_NOT_INITIALIZED
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy)
#define EGL_MAX_PBUFFER_HEIGHT
#define EGL_BAD_CURRENT_SURFACE
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
#define EGL_OPENGL_ES2_BIT
EGLAPI const char *EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name)
#define EGL_CONTEXT_CLIENT_VERSION
#define EGL_NATIVE_VISUAL_TYPE
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api)
#define EGL_BAD_NATIVE_WINDOW
#define EGL_ALPHA_MASK_SIZE
#define EGL_MATCH_NATIVE_PIXMAP
#define EGL_OPENGL_ES_API
#define EGL_COLOR_BUFFER_TYPE
#define EGL_BIND_TO_TEXTURE_RGB
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine)
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id)
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval)
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname)
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void)
#define EGL_MAX_PBUFFER_PIXELS
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
#define EGL_BAD_ATTRIBUTE
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
#define EGL_TRANSPARENT_TYPE
EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay(EGLenum platform, void *native_display, const EGLAttrib *attrib_list)
EGLAPI EGLint EGLAPIENTRY eglGetError(void)
EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
#define EGL_MIN_SWAP_INTERVAL
EGLSurface EGLint attribute
#define EGL_GL_COLORSPACE_SRGB_KHR
#define EGL_CONTEXT_MINOR_VERSION_KHR
#define EGL_CONTEXT_MAJOR_VERSION_KHR
#define EGL_PLATFORM_DEVICE_EXT
#define EGL_OPENGL_ES3_BIT_KHR
#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR
#define EGL_CONTEXT_FLAGS_KHR
#define EGL_GL_COLORSPACE_KHR
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR
static SDL_AudioDeviceID device
int framebuffer_srgb_capable
struct SDL_VideoDevice::@440 gl_config
SDL_bool gl_allow_no_surface
int share_with_current_context
static screen_context_t context