mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 17:17:09 -04:00
For SDL backend, reset graphics context if get a SDL_RENDER_DEVICE_RESET event
This commit is contained in:
parent
259a78b911
commit
d805d33d7d
@ -110,6 +110,7 @@ static void InitGraphicsMode(struct GraphicsMode* m) {
|
||||
*#########################################################################################################################*/
|
||||
#if defined CC_BUILD_SDL
|
||||
#include <SDL2/SDL.h>
|
||||
#include "Graphics.h"
|
||||
static SDL_Window* win_handle;
|
||||
|
||||
static void RefreshWindowBounds(void) {
|
||||
@ -350,6 +351,11 @@ void Window_ProcessEvents(void) {
|
||||
Event_RaiseVoid(&WindowEvents.Closing);
|
||||
SDL_DestroyWindow(win_handle);
|
||||
break;
|
||||
|
||||
case SDL_RENDER_DEVICE_RESET:
|
||||
Gfx_LoseContext("SDL device reset event");
|
||||
Gfx_RecreateContext();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user