Skip to content
Snippets Groups Projects
Commit 36fa8450 authored by namark's avatar namark
Browse files

Framebuffer size getter for gl_window,

and a couple of minor const noexcept changes.
parent e8538ebd
No related branches found
No related tags found
No related merge requests found
...@@ -71,7 +71,7 @@ void gl_window::update() noexcept ...@@ -71,7 +71,7 @@ void gl_window::update() noexcept
SDL_GL_SwapWindow(guts().get()); SDL_GL_SwapWindow(guts().get());
} }
auto gl_window::vsync() -> vsync_mode auto gl_window::vsync() const noexcept -> vsync_mode
{ {
return static_cast<vsync_mode>(SDL_GL_GetSwapInterval()); return static_cast<vsync_mode>(SDL_GL_GetSwapInterval());
} }
...@@ -82,9 +82,16 @@ void gl_window::require_vsync(vsync_mode mode) ...@@ -82,9 +82,16 @@ void gl_window::require_vsync(vsync_mode mode)
SDL_GL_SetSwapInterval(support::to_integer(mode)) ); SDL_GL_SetSwapInterval(support::to_integer(mode)) );
} }
bool gl_window::request_vsync(vsync_mode mode) bool gl_window::request_vsync(vsync_mode mode) noexcept
{ {
return !sdlcore::utils::check_error( return !sdlcore::utils::check_error(
SDL_GL_SetSwapInterval(support::to_integer(mode)) ); SDL_GL_SetSwapInterval(support::to_integer(mode)) );
} }
int2 gl_window::framebuffer_size() const noexcept
{
int2 size;
SDL_GL_GetDrawableSize(guts().get(), &size.x(), &size.y());
return size;
}
...@@ -262,10 +262,12 @@ namespace simple::graphical ...@@ -262,10 +262,12 @@ namespace simple::graphical
void update() noexcept; void update() noexcept;
vsync_mode vsync(); vsync_mode vsync() const noexcept;
bool request_vsync(vsync_mode); bool request_vsync(vsync_mode) noexcept;
void require_vsync(vsync_mode); void require_vsync(vsync_mode);
int2 framebuffer_size() const noexcept;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment