feat: fullscreen toggling support

This commit is contained in:
2025-10-14 21:38:20 +02:00
parent 75e1748302
commit e38bb50245

View File

@ -104,8 +104,13 @@ void Window::ProcessEvents() {
if (event.key.scancode == SDL_SCANCODE_ESCAPE) { if (event.key.scancode == SDL_SCANCODE_ESCAPE) {
Dispatch(WindowCloseRequested()); Dispatch(WindowCloseRequested());
} }
if (event.key.scancode == SDL_SCANCODE_F11) {
bool isFullscreen = SDL_GetWindowFlags(m_handle) & SDL_WINDOW_FULLSCREEN;
SDL_SetWindowFullscreen(m_handle, !isFullscreen);
}
break; break;
case SDL_EVENT_WINDOW_RESIZED: case SDL_EVENT_WINDOW_RESIZED:
case SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED:
int width, height; int width, height;
if (SDL_GetWindowSizeInPixels(m_handle, &width, &height)) { if (SDL_GetWindowSizeInPixels(m_handle, &width, &height)) {
m_width = width; m_width = width;