Fix the fullscreen functions for SDL2.
This commit is contained in:
parent
a5ebded0cb
commit
a87046bff7
2 changed files with 14 additions and 0 deletions
|
@ -447,10 +447,17 @@ static bool fullscreen(CVideo& video)
|
|||
const SDL_Rect& rect = screen_area();
|
||||
|
||||
SDL_Event event;
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
event.type = SDL_WINDOWEVENT;
|
||||
event.window.event = SDL_WINDOWEVENT_RESIZED;
|
||||
event.window.data1 = rect.w;
|
||||
event.window.data2 = rect.h;
|
||||
#else
|
||||
event.type = SDL_VIDEORESIZE;
|
||||
event.resize.type = SDL_VIDEORESIZE;
|
||||
event.resize.w = rect.w;
|
||||
event.resize.h = rect.h;
|
||||
#endif
|
||||
|
||||
SDL_PushEvent(&event);
|
||||
|
||||
|
|
|
@ -168,10 +168,17 @@ static bool fullscreen(CVideo& video)
|
|||
const SDL_Rect& rect = screen_area();
|
||||
|
||||
SDL_Event event;
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
event.type = SDL_WINDOWEVENT;
|
||||
event.window.event = SDL_WINDOWEVENT_RESIZED;
|
||||
event.window.data1 = rect.w;
|
||||
event.window.data2 = rect.h;
|
||||
#else
|
||||
event.type = SDL_VIDEORESIZE;
|
||||
event.resize.type = SDL_VIDEORESIZE;
|
||||
event.resize.w = rect.w;
|
||||
event.resize.h = rect.h;
|
||||
#endif
|
||||
|
||||
SDL_PushEvent(&event);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue