mirror of https://github.com/OpenTTD/OpenTTD
Fix: Check for a validly mapped OpenGL screen buffer during driver init. (#9007)
parent
d50b934bb4
commit
5644c00482
|
@ -69,6 +69,11 @@ const char *VideoDriver_SDL_OpenGL::Start(const StringList ¶m)
|
||||||
int w, h;
|
int w, h;
|
||||||
SDL_GetWindowSize(this->sdl_window, &w, &h);
|
SDL_GetWindowSize(this->sdl_window, &w, &h);
|
||||||
this->ClientSizeChanged(w, h, true);
|
this->ClientSizeChanged(w, h, true);
|
||||||
|
/* We should have a valid screen buffer now. If not, something went wrong and we should abort. */
|
||||||
|
if (_screen.dst_ptr == nullptr) {
|
||||||
|
this->Stop();
|
||||||
|
return "Can't get pointer to screen buffer";
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1305,6 +1305,12 @@ const char *VideoDriver_Win32OpenGL::Start(const StringList ¶m)
|
||||||
}
|
}
|
||||||
|
|
||||||
this->ClientSizeChanged(this->width, this->height, true);
|
this->ClientSizeChanged(this->width, this->height, true);
|
||||||
|
/* We should have a valid screen buffer now. If not, something went wrong and we should abort. */
|
||||||
|
if (_screen.dst_ptr == nullptr) {
|
||||||
|
this->Stop();
|
||||||
|
_cur_resolution = old_res;
|
||||||
|
return "Can't get pointer to screen buffer";
|
||||||
|
}
|
||||||
|
|
||||||
MarkWholeScreenDirty();
|
MarkWholeScreenDirty();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue