Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question/* Fonctions appelées par des timers Auteur : Krust Date : 18 02 04 */ UINT uResult; void CALLBACK Moves(HWND,UINT,UINT,DWORD); void CALLBACK GetFPS(HWND,UINT,UINT,DWORD); void CreatTimers(void){ uResult = SetTimer(hWnd,(int)1,10,(TIMERPROC) Moves); uResult = SetTimer(hWnd,(int)2,1000,(TIMERPROC) GetFPS); } VOID CALLBACK Moves( HWND hwnd, // handle to window for timer messages UINT message, // WM_TIMER message UINT idTimer, // timer identifier DWORD dwTime) // current system time { // Actions keyboard if(keys[VK_UP]) SetPosition(1); if(keys[VK_DOWN]) SetPosition(0); if(keys[VK_LEFT]) SetPosition(3); if(keys[VK_RIGHT]) SetPosition(2); // Actions Mouse GetCursorPos(&mousePos); SetViewMouse(mousePos,MouseRef); SetCursorPos(MouseRef.x,MouseRef.y); } VOID CALLBACK GetFPS( HWND hwnd, // handle to window for timer messages UINT message, // WM_TIMER message UINT idTimer, // timer identifier DWORD dwTime) // current system time { FPS2=FPS; FPS=0; }