mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-24 12:51:09 +00:00
Add vid_maxfps support for Windows and Linux
This commit is contained in:
parent
1594cc9570
commit
276fb7dbb2
2 changed files with 12 additions and 0 deletions
|
@ -459,6 +459,13 @@ void SDLGLFB::NewRefreshRate ()
|
|||
|
||||
void SDLGLFB::SwapBuffers()
|
||||
{
|
||||
#ifndef __APPLE__
|
||||
if (vid_maxfps && !cl_capfps)
|
||||
{
|
||||
SEMAPHORE_WAIT(FPSLimitSemaphore)
|
||||
}
|
||||
#endif
|
||||
|
||||
SDL_GL_SwapWindow (Screen);
|
||||
}
|
||||
|
||||
|
|
|
@ -1149,6 +1149,11 @@ void Win32GLFrameBuffer::SetVSync (bool vsync)
|
|||
|
||||
void Win32GLFrameBuffer::SwapBuffers()
|
||||
{
|
||||
// Limiting the frame rate is as simple as waiting for the timer to signal this event.
|
||||
if (FPSLimitEvent != NULL)
|
||||
{
|
||||
WaitForSingleObject(FPSLimitEvent, 1000);
|
||||
}
|
||||
::SwapBuffers(static_cast<Win32GLVideo *>(Video)->m_hDC);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue