|
SDLGameEngine
|
00001 #ifndef _SGEEVENT_H 00002 #define _SGEEVENT_H 00003 00004 #ifdef __cplusplus 00005 extern "C" { 00006 #endif 00007 00012 /* 00013 * Copyright (c) 2007 Heiko Irrgang 00014 * 00015 * The license and distribution terms for this file may be 00016 * found in the file COPYING in this distribution or at 00017 * http://93-interactive.com/cms/products/software/sdl-game-engine/license/ 00018 */ 00019 00039 #define SGEEVENT SDL_Event 00040 00045 #define EVENT_HANDLED 1 00046 00051 #define EVENT_UNHANDLED 0 00052 00057 #define MOUSE_LEFT SDL_BUTTON_LEFT 00058 00062 #define MOUSE_RIGHT SDL_BUTTON_RIGHT 00063 00067 #define MOUSE_MIDDLE SDL_BUTTON_MIDDLE 00068 00072 #define MOUSE_WHEEL_UP SDL_BUTTON_WHEELUP 00073 00077 #define MOUSE_WHEEL_DOWN SDL_BUTTON_WHEELDOWN 00078 00083 #define PRESSED 1 00084 00089 #define RELEASED 2 00090 00096 typedef struct { 00097 Uint32 held; 00098 Uint32 pressed; 00099 Uint32 released; 00100 } SGEEVENTSTATEINPUT; 00101 00107 typedef struct { 00108 SGEEVENTSTATEINPUT up; 00109 SGEEVENTSTATEINPUT down; 00110 SGEEVENTSTATEINPUT right; 00111 SGEEVENTSTATEINPUT left; 00112 SGEEVENTSTATEINPUT start; 00113 SGEEVENTSTATEINPUT select; 00114 SGEEVENTSTATEINPUT fire; 00115 SGEEVENTSTATEINPUT l1; 00116 SGEEVENTSTATEINPUT r1; 00117 SGEEVENTSTATEINPUT a; 00118 SGEEVENTSTATEINPUT b; 00119 SGEEVENTSTATEINPUT x; 00120 SGEEVENTSTATEINPUT y; 00121 SGEEVENTSTATEINPUT volUp; 00122 SGEEVENTSTATEINPUT volDown; 00123 } SGEEVENTSTATE; 00124 00138 int sgeKeyUp(SDL_Event *e, int type); 00139 00141 int sgeKeyDown(SDL_Event *e, int type); 00143 int sgeKeyLeft(SDL_Event *e, int type); 00145 int sgeKeyRight(SDL_Event *e, int type); 00147 int sgeKeyStart(SDL_Event *e, int type); 00149 int sgeKeySelect(SDL_Event *e, int type); 00151 int sgeKeyFire(SDL_Event *e, int type); 00153 int sgeKeyL1(SDL_Event *e, int type); 00155 int sgeKeyR1(SDL_Event *e, int type); 00157 int sgeKeyA(SDL_Event *e, int type); 00159 int sgeKeyB(SDL_Event *e, int type); 00161 int sgeKeyX(SDL_Event *e, int type); 00163 int sgeKeyY(SDL_Event *e, int type); 00165 int sgeKeyVolUp(SDL_Event *e, int type); 00167 int sgeKeyVolDown(SDL_Event *e, int type); 00168 00172 void sgeClearEvents(void); 00173 00177 void sgeEventApply(SGEEVENTSTATE *state, SDL_Event *event); 00178 00182 void sgeEventResetInputs(SGEEVENTSTATE *state); 00183 00184 // }@ 00185 00186 #ifdef __cplusplus 00187 } 00188 #endif 00189 00190 #endif