Original Post
Hi guys,
I just noticed that my game is jerky when Vsync is off. Everything is silky smooth when it's on. I really don't know where to start.
Here is my loop:
while(msg.message != WM_QUIT){
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else{
QueryPerformanceCounter((LARGE_INTEGER*)&cur_time);
time_span=(cur_time-last_time)*time_factor;
last_time=cur_time;
game->heartbeat(timespan);
}
My objects are timespan based like so:
position.x+=velocity.x*timespan;
position.y+=velocity.y*timespan;
What do you think it could be ?
I'm using Win 8 Pro if that matters.
Please help, thanks.
I just noticed that my game is jerky when Vsync is off. Everything is silky smooth when it's on. I really don't know where to start.
Here is my loop:
while(msg.message != WM_QUIT){
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else{
QueryPerformanceCounter((LARGE_INTEGER*)&cur_time);
time_span=(cur_time-last_time)*time_factor;
last_time=cur_time;
game->heartbeat(timespan);
}
My objects are timespan based like so:
position.x+=velocity.x*timespan;
position.y+=velocity.y*timespan;
What do you think it could be ?
I'm using Win 8 Pro if that matters.
Please help, thanks.