mirror of
https://github.com/TASEmulators/desmume
synced 2025-10-06 00:32:43 +02:00
posix: in __glx_initOpenGL, add null check after XOpenDisplay (#920)
* posix: in `__glx_initOpenGL`, add null check after `XOpenDisplay` Would segfault when built with GLX enabled and ran in Wayland. Now the same scenario instead falls back to the SoftRasterizer. Still not ideal, but using SDL as a fallback requires considerably more code redesign. * posix: refine GLX with no X server error message
This commit is contained in:
@@ -65,6 +65,10 @@ static bool __glx_initOpenGL(const int requestedProfile, const int requestedVers
|
||||
}
|
||||
|
||||
currDisplay = XOpenDisplay(NULL);
|
||||
if (currDisplay == NULL) {
|
||||
puts("GLX: Failed to connect to the X display. (GLX requires a compatible X Server.");
|
||||
return false;
|
||||
}
|
||||
|
||||
int currScreen = DefaultScreen(currDisplay);
|
||||
int glxMajorVersion = 0;
|
||||
|
Reference in New Issue
Block a user