What's wrong with processing the messages and simply setting a flag in an array?
- Code:
char g_keystates[256];
...
case WM_KEYDOWN:
wParam &= 0xff;
g_keystates[wParam]=1;
break;
case WM_KEYUP:
wParam &= 0xff;
g_keystates[wParam]=0;
break;
Then in your game code just check the state of the key in your array:
- Code:
if (g_keystates[32])
//Space bar is down
Jump();
You can also look into GetKeyState, although I've never used it with GAPI.
The advantage with keeping your own array is it makes your code more portable. Your actual game code relies only on your array of key states, so all the platform-specific code can be in one place and not spread out throughout your code.
Dan East