mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-09 14:27:06 +00:00
[client] pre-calculate the frame time
This commit is contained in:
parent
692d48df87
commit
5842ce23a3
@ -68,6 +68,7 @@ struct AppState
|
||||
struct KVMFRHeader * shm;
|
||||
unsigned int shmSize;
|
||||
|
||||
uint64_t frameTime;
|
||||
uint64_t lastFrameTime;
|
||||
uint64_t renderTime;
|
||||
uint64_t frameCount;
|
||||
@ -222,7 +223,7 @@ int renderThread(void * unused)
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t nsec = time.tv_nsec + (1e9 / params.fpsLimit);
|
||||
uint64_t nsec = time.tv_nsec + state.frameTime;
|
||||
if (nsec > 1e9)
|
||||
{
|
||||
time.tv_nsec = nsec - 1e9;
|
||||
@ -760,6 +761,7 @@ int run()
|
||||
state.running = true;
|
||||
state.scaleX = 1.0f;
|
||||
state.scaleY = 1.0f;
|
||||
state.frameTime = 1e9 / params.fpsLimit;
|
||||
|
||||
char* XDG_SESSION_TYPE = getenv("XDG_SESSION_TYPE");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user