Mercurial > hg > Members > kono > Cerium
annotate old/simple_render/trash/pad.cpp @ 985:e40dd2384357
fix light data update
author | root@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Fri, 01 Oct 2010 02:49:38 +0900 |
parents | 735f76483bb2 |
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 } |