Rename variables in SDL_egl.c to be more intuitive
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c
index ce9a213..bd1578a 100644
--- a/src/video/SDL_egl.c
+++ b/src/video/SDL_egl.c
@@ -114,7 +114,7 @@
_this->egl_data->NAME = (void *)NAME;
#else
#define LOAD_FUNC(NAME) \
-_this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
+_this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->egl_dll_handle, #NAME); \
if (!_this->egl_data->NAME) \
{ \
return SDL_SetError("Could not retrieve EGL function " #NAME); \
@@ -250,12 +250,12 @@ SDL_EGL_GetProcAddress(_THIS, const char *proc)
/* Try SDL_LoadFunction() first for EGL <= 1.4, or as a fallback for >= 1.5. */
if (!retval) {
static char procname[64];
- retval = SDL_LoadFunction(_this->egl_data->egl_dll_handle, proc);
+ retval = SDL_LoadFunction(_this->egl_data->opengl_dll_handle, proc);
/* just in case you need an underscore prepended... */
if (!retval && (SDL_strlen(proc) < (sizeof (procname) - 1))) {
procname[0] = '_';
SDL_strlcpy(procname + 1, proc, sizeof (procname) - 1);
- retval = SDL_LoadFunction(_this->egl_data->egl_dll_handle, procname);
+ retval = SDL_LoadFunction(_this->egl_data->opengl_dll_handle, procname);
}
}
#endif
@@ -280,14 +280,14 @@ SDL_EGL_UnloadLibrary(_THIS)
_this->egl_data->egl_display = NULL;
}
- if (_this->egl_data->dll_handle) {
- SDL_UnloadObject(_this->egl_data->dll_handle);
- _this->egl_data->dll_handle = NULL;
- }
if (_this->egl_data->egl_dll_handle) {
SDL_UnloadObject(_this->egl_data->egl_dll_handle);
_this->egl_data->egl_dll_handle = NULL;
}
+ if (_this->egl_data->opengl_dll_handle) {
+ SDL_UnloadObject(_this->egl_data->opengl_dll_handle);
+ _this->egl_data->opengl_dll_handle = NULL;
+ }
SDL_free(_this->egl_data);
_this->egl_data = NULL;
@@ -297,7 +297,7 @@ SDL_EGL_UnloadLibrary(_THIS)
int
SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path)
{
- void *dll_handle = NULL, *egl_dll_handle = NULL; /* The naming is counter intuitive, but hey, I just work here -- Gabriel */
+ void *egl_dll_handle = NULL, *opengl_dll_handle = NULL;
const char *path = NULL;
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
const char *d3dcompiler;
@@ -349,32 +349,32 @@ SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path)
/* A funny thing, loading EGL.so first does not work on the Raspberry, so we load libGL* first */
path = SDL_getenv("SDL_VIDEO_GL_DRIVER");
if (path != NULL) {
- egl_dll_handle = SDL_LoadObject(path);
+ opengl_dll_handle = SDL_LoadObject(path);
}
- if (egl_dll_handle == NULL) {
+ if (opengl_dll_handle == NULL) {
if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
if (_this->gl_config.major_version > 1) {
path = DEFAULT_OGL_ES2;
- egl_dll_handle = SDL_LoadObject(path);
+ opengl_dll_handle = SDL_LoadObject(path);
#ifdef ALT_OGL_ES2
- if (egl_dll_handle == NULL && !vc4) {
+ if (opengl_dll_handle == NULL && !vc4) {
path = ALT_OGL_ES2;
- egl_dll_handle = SDL_LoadObject(path);
+ opengl_dll_handle = SDL_LoadObject(path);
}
#endif
} else {
path = DEFAULT_OGL_ES;
- egl_dll_handle = SDL_LoadObject(path);
- if (egl_dll_handle == NULL) {
+ opengl_dll_handle = SDL_LoadObject(path);
+ if (opengl_dll_handle == NULL) {
path = DEFAULT_OGL_ES_PVR;
- egl_dll_handle = SDL_LoadObject(path);
+ opengl_dll_handle = SDL_LoadObject(path);
}
#ifdef ALT_OGL_ES2
- if (egl_dll_handle == NULL && !vc4) {
+ if (opengl_dll_handle == NULL && !vc4) {
path = ALT_OGL_ES2;
- egl_dll_handle = SDL_LoadObject(path);
+ opengl_dll_handle = SDL_LoadObject(path);
}
#endif
}
@@ -382,47 +382,47 @@ SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path)
#ifdef DEFAULT_OGL
else {
path = DEFAULT_OGL;
- egl_dll_handle = SDL_LoadObject(path);
+ opengl_dll_handle = SDL_LoadObject(path);
#ifdef ALT_OGL
- if (egl_dll_handle == NULL) {
+ if (opengl_dll_handle == NULL) {
path = ALT_OGL;
- egl_dll_handle = SDL_LoadObject(path);
+ opengl_dll_handle = SDL_LoadObject(path);
}
#endif
}
#endif
}
- _this->egl_data->egl_dll_handle = egl_dll_handle;
+ _this->egl_data->opengl_dll_handle = opengl_dll_handle;
- if (egl_dll_handle == NULL) {
+ if (opengl_dll_handle == NULL) {
return SDL_SetError("Could not initialize OpenGL / GLES library");
}
/* Loading libGL* in the previous step took care of loading libEGL.so, but we future proof by double checking */
if (egl_path != NULL) {
- dll_handle = SDL_LoadObject(egl_path);
+ egl_dll_handle = SDL_LoadObject(egl_path);
}
/* Try loading a EGL symbol, if it does not work try the default library paths */
- if (dll_handle == NULL || SDL_LoadFunction(dll_handle, "eglChooseConfig") == NULL) {
- if (dll_handle != NULL) {
- SDL_UnloadObject(dll_handle);
+ if (egl_dll_handle == NULL || SDL_LoadFunction(egl_dll_handle, "eglChooseConfig") == NULL) {
+ if (egl_dll_handle != NULL) {
+ SDL_UnloadObject(egl_dll_handle);
}
path = SDL_getenv("SDL_VIDEO_EGL_DRIVER");
if (path == NULL) {
path = DEFAULT_EGL;
}
- dll_handle = SDL_LoadObject(path);
+ egl_dll_handle = SDL_LoadObject(path);
#ifdef ALT_EGL
- if (dll_handle == NULL && !vc4) {
+ if (egl_dll_handle == NULL && !vc4) {
path = ALT_EGL;
- dll_handle = SDL_LoadObject(path);
+ egl_dll_handle = SDL_LoadObject(path);
}
#endif
- if (dll_handle == NULL || SDL_LoadFunction(dll_handle, "eglChooseConfig") == NULL) {
- if (dll_handle != NULL) {
- SDL_UnloadObject(dll_handle);
+ if (egl_dll_handle == NULL || SDL_LoadFunction(egl_dll_handle, "eglChooseConfig") == NULL) {
+ if (egl_dll_handle != NULL) {
+ SDL_UnloadObject(egl_dll_handle);
}
return SDL_SetError("Could not load EGL library");
}
@@ -430,9 +430,9 @@ SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path)
}
#endif
- _this->egl_data->dll_handle = dll_handle;
-#if SDL_VIDEO_DRIVER_VITA
_this->egl_data->egl_dll_handle = egl_dll_handle;
+#if SDL_VIDEO_DRIVER_VITA
+ _this->egl_data->opengl_dll_handle = opengl_dll_handle;
#endif
/* Load new function pointers */
diff --git a/src/video/SDL_egl_c.h b/src/video/SDL_egl_c.h
index 1827af0..76d26f9 100644
--- a/src/video/SDL_egl_c.h
+++ b/src/video/SDL_egl_c.h
@@ -33,7 +33,7 @@
typedef struct SDL_EGL_VideoData
{
- void *egl_dll_handle, *dll_handle;
+ void *opengl_dll_handle, *egl_dll_handle;
EGLDisplay egl_display;
EGLConfig egl_config;
int egl_swapinterval;
diff --git a/src/video/winrt/SDL_winrtopengles.cpp b/src/video/winrt/SDL_winrtopengles.cpp
index 9e3c177..d530100 100644
--- a/src/video/winrt/SDL_winrtopengles.cpp
+++ b/src/video/winrt/SDL_winrtopengles.cpp
@@ -63,7 +63,7 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path)
}
/* Load ANGLE/WinRT-specific functions */
- CreateWinrtEglWindow_Old_Function CreateWinrtEglWindow = (CreateWinrtEglWindow_Old_Function) SDL_LoadFunction(_this->egl_data->egl_dll_handle, "CreateWinrtEglWindow");
+ CreateWinrtEglWindow_Old_Function CreateWinrtEglWindow = (CreateWinrtEglWindow_Old_Function) SDL_LoadFunction(_this->egl_data->opengl_dll_handle, "CreateWinrtEglWindow");
if (CreateWinrtEglWindow) {
/* 'CreateWinrtEglWindow' was found, which means that an an older
* version of ANGLE/WinRT is being used. Continue setting up EGL,