Make window resizable

This commit is contained in:
kichikuou
2021-08-14 13:28:56 +09:00
parent c58d5b690a
commit 6ec42bbdfc
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");
Uint32 flags = SDL_WINDOW_FULLSCREEN;
#else
Uint32 flags = 0;
Uint32 flags = SDL_WINDOW_RESIZABLE;
#endif
g_window = SDL_CreateWindow("Scenario Decoder SYSTEM3", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 400, flags);
+8
View File
@@ -28,6 +28,14 @@ void NACT::pump_events()
terminate = true;
break;
case SDL_WINDOWEVENT:
switch (e.window.event) {
case SDL_WINDOWEVENT_SIZE_CHANGED:
ags->flush_screen(false);
break;
}
break;
case SDL_MOUSEMOTION:
mousex = e.motion.x;
mousey = e.motion.y;