Mercurial > hg > Game > Cerium
annotate old/simple_render/trash/pad.cpp @ 1141:bc2dea061cb1 draft
minor fix
author | Yutaka_Kinjyo |
---|---|
date | Thu, 17 Feb 2011 20:28:26 +0900 |
parents | 3bc98f6d31ff |
children |
rev | line source |
---|---|
39 | 1 #include <iostream> |
2 #include <SDL.h> | |
3 #include <SDL_opengl.h> | |
4 #include "pad.h" | |
5 using namespace std; | |
6 | |
7 int pad(int button) | |
8 { | |
9 Uint8 *keys=SDL_GetKeyState(NULL); | |
10 | |
11 if(button==UP && keys[SDLK_UP]==SDL_PRESSED) | |
12 { | |
13 return 1; | |
14 } | |
15 if(button==DOWN && keys[SDLK_DOWN]==SDL_PRESSED) | |
16 { | |
17 return 1; | |
18 } | |
19 if(button==RIGHT && keys[SDLK_RIGHT]==SDL_PRESSED) | |
20 { | |
21 return 1; | |
22 } | |
23 if(button==LEFT && keys[SDLK_LEFT]==SDL_PRESSED) | |
24 { | |
25 return 1; | |
26 } | |
27 return 0; | |
28 } |