Support getting current vsync status in app
This commit is contained in:
parent
249ca33aab
commit
35de0993d2
2 changed files with 6 additions and 0 deletions
|
|
@ -41,6 +41,7 @@ namespace psemek::app
|
|||
std::unique_ptr<scene> pop_scene() override;
|
||||
|
||||
void show_cursor(bool show);
|
||||
bool vsync() const;
|
||||
void vsync(bool on);
|
||||
|
||||
float time() const;
|
||||
|
|
|
|||
|
|
@ -274,6 +274,11 @@ namespace psemek::app
|
|||
return std::chrono::duration_cast<std::chrono::duration<float>>(clock::now() - impl().start_time).count();
|
||||
}
|
||||
|
||||
bool app::vsync() const
|
||||
{
|
||||
return SDL_GL_GetSwapInterval() != 0;
|
||||
}
|
||||
|
||||
void app::vsync(bool on)
|
||||
{
|
||||
if (on)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue