evening2005
Member
- Joined
- Sep 23, 2005
- Messages
- 137
Hi all,
First of all, a big "thanks" to the community; with your help I've managed to build simple SDL programs on both Windows and Linux (not tried OSX yet, but that should work too) and get them working on the GP2X. I'm now at the point when I want to port my little pong demonstration, and it works apart from the fact that I don't know what events my event handler should be looking for. To be honest, I've never messed with SDL "under the hood" so I'm not at all sure how simple what I want is. At the moment, my pong game just reads the keyboard:
I'm not at all sure what I should be looking for instead of SDLK_UP and SDLK_DOWN in the excerpt above. Can anyone offer any pointers? Do I need to work at a lower level, or are the buttons and joystick directions mapped to other (existing) SDLK_ constants?
Thanks for any help you can offer!
First of all, a big "thanks" to the community; with your help I've managed to build simple SDL programs on both Windows and Linux (not tried OSX yet, but that should work too) and get them working on the GP2X. I'm now at the point when I want to port my little pong demonstration, and it works apart from the fact that I don't know what events my event handler should be looking for. To be honest, I've never messed with SDL "under the hood" so I'm not at all sure how simple what I want is. At the moment, my pong game just reads the keyboard:
Code:
/* handle the keyboard */
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
case SDLK_ESCAPE:
case SDLK_q:
gameover = 1;
break;
case SDLK_UP:
playerBatMoveY = -playerBatSPEED;
break;
case SDLK_DOWN:
playerBatMoveY = +playerBatSPEED;
break;
}
break;
case SDL_KEYUP:
/*
etc etc etc
*/
I'm not at all sure what I should be looking for instead of SDLK_UP and SDLK_DOWN in the excerpt above. Can anyone offer any pointers? Do I need to work at a lower level, or are the buttons and joystick directions mapped to other (existing) SDLK_ constants?
Thanks for any help you can offer!