Change initial window size to 1024x768 & log window resize events
This commit is contained in:
parent
9e24c875a1
commit
fb2acde48f
1 changed files with 4 additions and 1 deletions
|
|
@ -83,7 +83,7 @@ namespace psemek::app
|
||||||
std::uint32_t flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL | SDL_WINDOW_MAXIMIZED | SDL_WINDOW_HIDDEN;
|
std::uint32_t flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL | SDL_WINDOW_MAXIMIZED | SDL_WINDOW_HIDDEN;
|
||||||
if (opts.highdpi) flags |= SDL_WINDOW_ALLOW_HIGHDPI;
|
if (opts.highdpi) flags |= SDL_WINDOW_ALLOW_HIGHDPI;
|
||||||
|
|
||||||
impl().window = SDL_CreateWindow(name.data(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, flags);
|
impl().window = SDL_CreateWindow(name.data(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1024, 768, flags);
|
||||||
if (!impl().window)
|
if (!impl().window)
|
||||||
sdl2::fail("Failed to create window: ");
|
sdl2::fail("Failed to create window: ");
|
||||||
|
|
||||||
|
|
@ -107,6 +107,8 @@ namespace psemek::app
|
||||||
int width, height;
|
int width, height;
|
||||||
SDL_GL_GetDrawableSize(impl().window, &width, &height);
|
SDL_GL_GetDrawableSize(impl().window, &width, &height);
|
||||||
scene_base::on_resize(width, height);
|
scene_base::on_resize(width, height);
|
||||||
|
|
||||||
|
log::info() << "Initial window size: " << width << 'x' << height;
|
||||||
}
|
}
|
||||||
|
|
||||||
app::~app()
|
app::~app()
|
||||||
|
|
@ -150,6 +152,7 @@ namespace psemek::app
|
||||||
int width, height;
|
int width, height;
|
||||||
SDL_GL_GetDrawableSize(impl().window, &width, &height);
|
SDL_GL_GetDrawableSize(impl().window, &width, &height);
|
||||||
handler()->on_resize(width, height);
|
handler()->on_resize(width, height);
|
||||||
|
log::info() << "Window resized to " << width << 'x' << height;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue