Skip to content

False alarm from SDL_CreateWindow when using Windows with ANGLE. #4177

@hanseuljun

Description

@hanseuljun

First, thanks for maintaining this wonderful library.

I was trying to use SDL with ANGLE (the Google GLES one), and found that setting
SDL_SetHint(SDL_HINT_OPENGL_ES_DRIVER, "1");

leads to a false error in SDL_CreateWindow at

SDL_assert(!_this->gl_config.driver_loaded);

What the above hint does is prevent SDL from using the default driver, from NVidia for AMD, so it would use the GL Driver of ANGLE. Based on the name of variable--gl_config.driver_loaded--I think the problem is, this hint makes SDL think that there is no GL driver loaded, while having access to the ANGLE's driver.

Based on this observation, I can think of two fixes.

  1. A quick fix would be removing the SDL_assert line since this is not a condition that should be avoided based on the current situation.
  2. The other (perhaps more proper) one would be setting gl_config.driver_loaded to 1 or something else when SDL_HINT_OPENGL_ES_DRIVER is set to 1.

I'll submit a pull request based on option 1.

Attaching the code using SDL and ANGLE below.
hello_windows.cpp.txt

Metadata

Metadata

Assignees

Labels

early in milestoneThis change should be made early in the milestone for additional testing

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions