|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Jun 2002
Città: Dublin
Messaggi: 5989
|
[C++] Timer e WM_TIMER
Non so se sono l'unico, ma non capisco le API di Windows. La guida mi dice che impostando TimerProc su NULL Windows manda un messaggio WM_TIMER alla finestra. Questo non mi succede usando
Codice:
case WM_CREATE:
timerid = SetTimer (hwnd, IDTIMER, TIMDLAY, (TIMERPROC) NULL);
if ( timerid == 0)
MessageBox (hwnd, "No timer available.", "Error", MB_ICONINFORMATION);
break;
case WM_TIMER:
BYTE *keystate;
GetKeyboardState (keystate);
if ( keystate[VK_DOWN ] ) plane.y += movement;
if ( keystate[VK_UP ] ) plane.y -= movement;
if ( keystate[VK_RIGHT] ) plane.x += movement;
if ( keystate[VK_LEFT ] ) plane.x -= movement;
keystate = NULL;
Redraw ();
break;
__________________
C'ho certi cazzi Mafa' che manco tu che sei pratica li hai visti mai! |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 19:02.



















