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 2583 - "ERROR: Failed loading eglChooseConfig" message when using opengles2 with windows+ANGLE
Summary: "ERROR: Failed loading eglChooseConfig" message when using opengles2 with win...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.3
Hardware: x86 Windows 7
: P2 normal
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-13 13:01 UTC by gdecarp
Modified: 2014-06-16 12:48 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gdecarp 2014-06-13 13:01:06 UTC
DESCRIPTION:
When running the opengles2 driver on windows with ANGLE (and using at an error+ logging priority), i get the following dumped message when calling SDL_CreateWindow() with SDL_WINDOW_OPENGL enabled (and at a later point when i try to use SDL_CreateWindow() without SDL_WINDOW_OPENGL):

"ERROR: Failed loading eglChooseConfig: The specified procedure could not be found."


MINIMAL REPRO CODE (again, on windows using ANGLE):
SDL_Init(SDL_INIT_VIDEO);
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengles2");
SDL_GL_SetAttribute(SDL_GL_CONTEXT_EGL, 1);
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_ERROR);
SDL_CreateWindow("Window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN);

FIX:
The issue is caused by the call to SDL_LoadFunction() with an invalid parameter (a null dll_handle) in SDL_EGL_LoadLibrary() in SDL_egl.c. 
 
One possible fix is to change line 185 in SDL_egl.c from:

 if (SDL_LoadFunction(dll_handle, "eglChooseConfig") == NULL) {

to:

 if (dll_handle == NULL || SDL_LoadFunction(dll_handle, "eglChooseConfig") == NULL) {
Comment 1 Sam Lantinga 2014-06-16 00:19:54 UTC
Gabriel, can you verify that this is the correct fix?

Thanks!
Comment 2 Gabriel Jacobo 2014-06-16 12:48:13 UTC
Fixed, thanks!