Hi,
I've made a very simple program that blits a fullscreen image to screen and a little sprite using GAPI calls. I have a decent frame rate : arount 50 FPS, so 20 ms to build each frame.
...
BUT
...
Some frames, say every 1 or 2 seconds require more than 100ms to be built !!!! Then, the moving sprite hasn't a smooth move : very annoying !
Each frame, I use this code to handle events :
Am I doing something wrong ?
It seems like there is some other process running in background that asks for processor time every 1 or 2 seconds. I have an iPAQ H2210, I first thought to disable Bluetooth but it wasn't better.
Maybe there is a way to give my game thread the highest priority ?
Thanks for your help !!!!
FYI, I trap those messages :
I've made a very simple program that blits a fullscreen image to screen and a little sprite using GAPI calls. I have a decent frame rate : arount 50 FPS, so 20 ms to build each frame.
...
BUT
...
Some frames, say every 1 or 2 seconds require more than 100ms to be built !!!! Then, the moving sprite hasn't a smooth move : very annoying !
Each frame, I use this code to handle events :
- Code:
MSG msg;
while (PeekMessage(&msg;, 0, 0, 0, PM_NOREMOVE) == TRUE)
{ GetMessage(&msg;, 0, 0, 0);
TranslateMessage(&msg;);
DispatchMessage(&msg;);
}
Am I doing something wrong ?
It seems like there is some other process running in background that asks for processor time every 1 or 2 seconds. I have an iPAQ H2210, I first thought to disable Bluetooth but it wasn't better.
Maybe there is a way to give my game thread the highest priority ?
Thanks for your help !!!!
FYI, I trap those messages :
- Code:
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ switch (message)
{ case WM_ENABLE:
break;
case WM_ACTIVATE:
...
break;
case WM_CREATE:
case WM_SETTINGCHANGE:
...
break;
case WM_LBUTTONDOWN:
...
break;
case WM_LBUTTONUP:
...
break;
case WM_MOUSEMOVE:
...
break;
case WM_DESTROY:
...
break;
case WM_KEYUP:
...
break;
case WM_KEYDOWN:
...
break;
case WM_KILLFOCUS:
...
break;
case WM_SETFOCUS:
...
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}