mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-31 21:30:36 +00:00
Don't call SDL_GetWindowDisplayIndex() with window == NULL
I got an SDL assertion because of this. The problem was that PrintDisplayModes() was called at startup before a window was created.
This commit is contained in:
parent
9bb0425e36
commit
77493e6e5b
1 changed files with 2 additions and 1 deletions
|
@ -263,10 +263,11 @@ InitDisplayIndices()
|
||||||
static void
|
static void
|
||||||
PrintDisplayModes(void)
|
PrintDisplayModes(void)
|
||||||
{
|
{
|
||||||
int curdisplay = SDL_GetWindowDisplayIndex(window);
|
int curdisplay = window ? SDL_GetWindowDisplayIndex(window) : 0;
|
||||||
|
|
||||||
// On X11 (at least for me)
|
// On X11 (at least for me)
|
||||||
// curdisplay is always -1.
|
// curdisplay is always -1.
|
||||||
|
// DG: probably because window was NULL?
|
||||||
if (curdisplay < 0) {
|
if (curdisplay < 0) {
|
||||||
curdisplay = 0;
|
curdisplay = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue