mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 02:25:32 -04:00
Make sure Gfx_LoseContext doesn't raise GfxEvents.ContextLost if context is already lost
This commit is contained in:
parent
5355bd66ca
commit
f965e99a85
@ -66,6 +66,7 @@ static void Gfx_LimitFPS(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Gfx_LoseContext(const char* reason) {
|
void Gfx_LoseContext(const char* reason) {
|
||||||
|
if (Gfx.LostContext) return;
|
||||||
Gfx.LostContext = true;
|
Gfx.LostContext = true;
|
||||||
Platform_Log1("Lost graphics context: %c", reason);
|
Platform_Log1("Lost graphics context: %c", reason);
|
||||||
|
|
||||||
@ -932,13 +933,7 @@ void Gfx_GetApiInfo(String* lines) {
|
|||||||
String_Format1(&lines[5], "Depth buffer bits: %i", &depthBits);
|
String_Format1(&lines[5], "Depth buffer bits: %i", &depthBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx_OnWindowResize(void) {
|
void Gfx_OnWindowResize(void) { Gfx_LoseContext(" (resizing window)"); }
|
||||||
if (Gfx.LostContext) return;
|
|
||||||
Gfx_LoseContext(" (resizing window)");
|
|
||||||
/* NOTE: Windows enters a size/move modal loop. (WM_ENTERSIZEMOVE) */
|
|
||||||
/* This blocks the normal game loop from running, which means */
|
|
||||||
/* Gfx_OnWindowResize can end up getting called multiple times. */
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user