Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Test/simple_render/trash/pad.cpp @ 176:08e2bb36639b
fix
author | gongo@localhost.localdomain |
---|---|
date | Tue, 16 Dec 2008 17:01:24 +0900 |
parents | b6858e9fe2b4 |
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 } |