comparison old/simple_render/trash/pad.cpp @ 507:735f76483bb2

Reorganization..
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 12 Oct 2009 09:39:35 +0900
parents TaskManager/Test/simple_render/trash/pad.cpp@b6858e9fe2b4
children
comparison
equal deleted inserted replaced
506:1d4a8a86f26b 507:735f76483bb2
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 }