Mercurial > hg > Game > Cerium
view old/simple_render/trash/pad.cpp @ 1870:44fa0f1320a9 draft
run wordcount with iterate
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 26 Dec 2013 17:05:49 +0900 |
parents | 3bc98f6d31ff |
children |
line wrap: on
line source
#include <iostream> #include <SDL.h> #include <SDL_opengl.h> #include "pad.h" using namespace std; int pad(int button) { Uint8 *keys=SDL_GetKeyState(NULL); if(button==UP && keys[SDLK_UP]==SDL_PRESSED) { return 1; } if(button==DOWN && keys[SDLK_DOWN]==SDL_PRESSED) { return 1; } if(button==RIGHT && keys[SDLK_RIGHT]==SDL_PRESSED) { return 1; } if(button==LEFT && keys[SDLK_LEFT]==SDL_PRESSED) { return 1; } return 0; }