1
0
Fork 0

Prevent a crash in Windows AMD drivers

Usually, when window is being created without SDL_WINDOW_OPENGL flag,
SDL2 internally re-creates it to support OpenGL during
SDL_CreateRenderer if needed.

This leads to crash in AMD OpenGL drivers (Windows only), which happens
for drivers: "opengl", "opengles", "opengles2".

When the window is created with correct flag from the get-go, the crash
does not happen.

On Linux, the code does not crash either way (at least not when using
Mesa and AMDGPU open source driver), so there's no point in propagating
the hack.

Also, remove a comment that is no longer relevant to the code below.
This commit is contained in:
Patryk Obara 2020-03-13 19:36:25 +01:00 committed by Patryk Obara
parent bb43294f68
commit 8d5bc9537a
2 changed files with 16 additions and 8 deletions

View file

@ -122,4 +122,9 @@ void upcase(std::string &str);
void lowcase(std::string &str);
void strip_punctuation(std::string &str);
template<size_t N>
bool starts_with(const char (& pfx)[N], const std::string &str) noexcept {
return (strncmp(pfx, str.c_str(), N) == 0);
}
#endif