zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Game.cpp
Go to the documentation of this file.
1 /* This file is part of the Zenipex Library (zenilib).
2  * Copyright (C) 2011 Mitchell Keith Bloch (bazald).
3  *
4  * zenilib is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * zenilib is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with zenilib. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include <zeni_rest.h>
19 
20 #include <Zeni/Define.h>
21 
22 #if defined(_DEBUG) && defined(_WINDOWS)
23 #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
24 #define new DEBUG_NEW
25 #endif
26 
27 #include <Zeni/Singleton.hxx>
28 
29 namespace Zeni {
30 
32  int g_argc = 0;
33  const char * const * g_argv = 0;
34  template class Singleton<Game>;
35 
36  Game * Game::create() {
37  return new Game;
38  }
39 
40  Game::Game()
41  : time(get_Timer().get_time()),
42  ticks_passed(0),
43  fps(END_OF_TIME),
44  fps_next(0),
45  m_popup_menu_state_factory(new Popup_Menu_State_Factory),
46  m_popup_pause_state_factory(new Popup_Pause_State_Factory)
47 #if !defined(ANDROID) && !defined(NDEBUG)
48  , m_console_active(false)
49 #endif
50  {
51  }
52 
53  Game::~Game() {
54  delete m_popup_menu_state_factory;
55  delete m_popup_pause_state_factory;
56  }
57 
58  Game & get_Game() {
59  return Singleton<Game>::get();
60  }
61 
62 #if !defined(ANDROID) && !defined(NDEBUG)
63  Console_State & Game::get_console() {
64  return static_cast<Console_State &>(get_console_instance().get());
65  }
66 #endif
67 
68 #if !defined(ANDROID) && !defined(NDEBUG)
69  void Game::write_to_console(const String &text) {
70  get_console().write_to_log(text);
71 #else
72  void Game::write_to_console(const String & /*text*/) {
73 #endif
74  }
75 
76  void Game::push_state(const Gamestate &state) {
77  if(!m_states.empty())
78  m_states.top().on_cover();
79 
80  m_states.push(state);
81 
82 #if !defined(ANDROID) && !defined(NDEBUG)
83  if(m_console_active)
84  get_console().set_child(m_states.top());
85 #endif
86 
87  m_states.top().on_push();
88  }
89 
90  Gamestate Game::pop_state() {
91  Gamestate gs;
92 
93  {
94  if(m_states.empty())
95  throw Zero_Gamestate();
96 
97  gs = m_states.top();
98  m_states.pop();
99 
100 #if !defined(ANDROID) && !defined(NDEBUG)
101  if(m_console_active) {
102  Console_State &csr = get_console();
103 
104  if(!m_states.empty())
105  csr.set_child(m_states.top());
106  else
107  csr.clear_child();
108  }
109 #endif
110  }
111 
112  gs.on_pop();
113 
114  if(!m_states.empty())
115  m_states.top().on_uncover();
116 
117  return gs;
118  }
119 
120 #ifdef ANDROID
121  void Game::on_event(android_app &app, const AInputEvent &event) {
122 #else
123  void Game::on_event(const SDL_Event &event) {
124  SDL_Event event2;
125  memcpy(&event2, &event, sizeof(SDL_Event));
126 
127  switch(event.type) {
128  case SDL_KEYDOWN:
129  m_keys[event.key.keysym.sym] = true;
130  break;
131 
132  case SDL_KEYUP:
133  m_keys[event.key.keysym.sym] = false;
134  break;
135 
136  case SDL_MOUSEBUTTONDOWN:
137  m_mouse_buttons[event.button.button] = true;
138  break;
139 
140  case SDL_MOUSEBUTTONUP:
141  m_mouse_buttons[event.button.button] = false;
142  break;
143 
145  {
147  m_controller_axes[event2.caxis.which][event2.caxis.axis] = event.caxis.value;
148  }
149  break;
150 
152  {
154  m_controller_buttons[event2.cbutton.which][event2.cbutton.button] = true;
155  }
156  break;
157 
159  {
161  m_controller_buttons[event2.cbutton.which][event2.cbutton.button] = false;
162  }
163  break;
164 
167  break;
168 
169  //case SDL_CONTROLLERDEVICEREMAPPED:
170  // get_Controllers().device_remapped(event.cdevice.which);
171  // break;
172 
174  //get_Controllers().device_removed(event.cdevice.which);
175  break;
176 
177  default:
178  break;
179  }
180 #endif
181 
182  Gamestate gs;
183 #if !defined(ANDROID) && !defined(NDEBUG)
184  Gamestate console_child;
185 #endif
186 
187  {
188  if(m_states.empty())
189  throw Zero_Gamestate();
190 
191 #if !defined(ANDROID) && !defined(NDEBUG)
192  if(m_console_active) {
193  gs = get_console_instance();
194  console_child = get_console().get_child();
195  }
196  else
197 #endif
198  {
199  gs = m_states.top();
200  }
201  }
202 
203 #ifdef ANDROID
204  gs.on_event(app, event2);
205 #else
206  gs.on_event(event2);
207 #endif
208  }
209 
210  void Game::perform_logic() {
211  Gamestate gs;
212 #if !defined(ANDROID) && !defined(NDEBUG)
213  Gamestate console_child;
214 #endif
215 
216  {
217  if(m_states.empty())
218  throw Zero_Gamestate();
219 
220 #if !defined(ANDROID) && !defined(NDEBUG)
221  if(m_console_active) {
222  gs = get_console_instance();
223  console_child = get_console().get_child();
224  }
225  else
226 #endif
227  {
228  gs = m_states.top();
229  }
230  }
231 
232  gs.perform_logic();
233  }
234 
235  void Game::prerender() {
236  Gamestate gs;
237 #if !defined(ANDROID) && !defined(NDEBUG)
238  Gamestate console_child;
239 #endif
240 
241  {
242  if(m_states.empty())
243  throw Zero_Gamestate();
244 
245 #if !defined(ANDROID) && !defined(NDEBUG)
246  if(m_console_active) {
247  gs = get_console_instance();
248  console_child = get_console().get_child();
249  }
250  else
251 #endif
252  {
253  gs = m_states.top();
254  }
255  }
256 
257  gs.prerender();
258  }
259 
260  void Game::render() {
261  Gamestate gs;
262 #if !defined(ANDROID) && !defined(NDEBUG)
263  Gamestate console_child;
264 #endif
265 
266  {
267  if(m_states.empty())
268  throw Zero_Gamestate();
269 
270 #if !defined(ANDROID) && !defined(NDEBUG)
271  if(m_console_active) {
272  gs = get_console_instance();
273  console_child = get_console().get_child();
274  }
275  else
276 #endif
277  {
278  gs = m_states.top();
279  }
280  }
281 
282  gs.render();
283 
284  calculate_fps();
285  }
286 
287  bool Game::get_key_state(const int &button) const {
288  const Unordered_Map<int, bool>::const_iterator it = m_keys.find(button);
289  if(it != m_keys.end())
290  return it->second;
291  return false;
292  }
293 
294  bool Game::get_mouse_button_state(const int &button) const {
295  const Unordered_Map<int, bool>::const_iterator it = m_mouse_buttons.find(button);
296  if(it != m_mouse_buttons.end())
297  return it->second;
298  return false;
299  }
300 
301  Sint16 Game::get_controller_axis_state(const int &which, const SDL_GameControllerAxis &axis) const {
302  const Unordered_Map<int, Unordered_Map<int, Sint16> >::const_iterator jt = m_controller_axes.find(which);
303 
304  if(jt != m_controller_axes.end()) {
305  const Unordered_Map<int, Sint16>::const_iterator it = jt->second.find(axis);
306  if(it != jt->second.end())
307  return it->second;
308  }
309 
310  return 0;
311  }
312 
313  bool Game::get_controller_button_state(const int &which, const SDL_GameControllerButton &button) const {
314  const Unordered_Map<int, Unordered_Map<int, bool> >::const_iterator jt = m_controller_buttons.find(which);
315 
316  if(jt != m_controller_buttons.end()) {
317  const Unordered_Map<int, bool>::const_iterator it = jt->second.find(button);
318  if(it != jt->second.end())
319  return it->second;
320  }
321 
322  return false;
323  }
324 
325  void Game::run() {
326 #ifdef TEST_NASTY_CONDITIONS
327  Random random;
328  const float time_scale = NASTY_MIN_RATE + (NASTY_MAX_RATE - NASTY_MIN_RATE) * random.frand_lte();
329  Time::Second_Type time_used = Time::Second_Type();
330  Time start_time;
331 #endif
332 
333  Time time_processed;
334 
335  for(;;) {
336  const Time time_passed;
337  float time_step = time_passed.get_seconds_since(time_processed);
338  time_processed = time_passed;
339 
340 #ifndef ANDROID
341  if(controller_mouse.enabled && (controller_mouse.velocity.x != 0 || controller_mouse.velocity.y != 0)) {
342  Point2f adjusted_vel(controller_mouse.velocity.x + 0.5f, controller_mouse.velocity.y + 0.5f);
343  if(adjusted_vel.x < 0.0f)
344  adjusted_vel.x = std::min(0.0f, adjusted_vel.x + controller_mouse.noise_zone.x);
345  else
346  adjusted_vel.x = std::max(0.0f, adjusted_vel.x - controller_mouse.noise_zone.x);
347  if(adjusted_vel.y < 0.0f)
348  adjusted_vel.y = std::min(0.0f, adjusted_vel.y + controller_mouse.noise_zone.y);
349  else
350  adjusted_vel.y = std::max(0.0f, adjusted_vel.y - controller_mouse.noise_zone.y);
351  adjusted_vel.x /= 32767.5f - controller_mouse.noise_zone.x;
352  adjusted_vel.y /= 32767.5f - controller_mouse.noise_zone.y;
353 
354  int xrel = int(adjusted_vel.x * controller_mouse.pixels_per_second.x * time_step);
355  int yrel = int(adjusted_vel.y * controller_mouse.pixels_per_second.y * time_step);
356 
357  if(xrel || yrel) {
358  int x, y;
359  SDL_GetMouseState(&x, &y);
360 
361  x += xrel;
362  y += yrel;
363  if(x < 0)
364  x = 0;
365  else if(x >= get_Window().get_width())
366  x = get_Window().get_width() - 1;
367  if(y < 0)
368  y = 0;
369  else if(y >= get_Window().get_width())
370  y = get_Window().get_height() - 1;
371 
372 #if SDL_VERSION_ATLEAST(2,0,0)
373  SDL_WarpMouseInWindow(get_Window().get_window(), x, y);
374 #else
375  SDL_WarpMouse(Uint16(x), Uint16(y));
376 #endif
377  }
378  }
379 
381 
382  for(SDL_Event event; SDL_PollEvent(&event);) {
383  if(event.type == SDL_KEYDOWN ||
384  event.type == SDL_KEYUP)
385  {
386  const SDL_Keysym &s = event.key.keysym;
387  const bool alt = get_key_state(SDLK_LALT) || get_key_state(SDLK_RALT);
388  const bool ctrl = get_key_state(SDLK_LCTRL) || get_key_state(SDLK_RCTRL);
389  const bool shift = get_key_state(SDLK_LSHIFT) || get_key_state(SDLK_RSHIFT);
390  const bool gui =
391 #if SDL_VERSION_ATLEAST(1,3,0)
392  get_key_state(SDLK_LGUI) || get_key_state(SDLK_RGUI);
393 #else
394  get_key_state(SDLK_LMETA) || get_key_state(SDLK_RMETA) || get_key_state(SDLK_LSUPER) || get_key_state(SDLK_RSUPER);
395 #endif
396 
397 #ifndef NDEBUG
398  if(s.sym == SDLK_BACKQUOTE && alt && !ctrl && !gui && !shift) {
399  if(event.type == SDL_KEYDOWN) {
400  if(m_console_active)
401  deactivate_console();
402  else
403  activate_console();
404  }
405 
406  continue;
407  }
408 #endif
409 
410  on_event(event);
411 
412  if(event.type == SDL_KEYDOWN && (
413 #if defined(_MACOSX)
414  (!alt && !ctrl && gui && !shift && s.sym == SDLK_q) ||
415 #endif
416  (!alt && ctrl && !gui && !shift && s.sym == SDLK_q) ||
417  ( alt && !ctrl && !gui && !shift && s.sym == SDLK_F4)))
418  {
419  throw Quit_Event();
420  }
421  }
422  else if(event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE) {
423  on_event(event);
424 
425  if(event.window.windowID == SDL_GetWindowID(get_Window().get_window())) {
426  get_Window().alert_window_destroyed();
427  throw Quit_Event();
428  }
429  }
430  else if(event.type == SDL_CONTROLLERAXISMOTION) {
431  if(controller_mouse.enabled && get_Controllers().get_controller_index(event.caxis.which) == 0 && (controller_mouse.controller_axes.x == event.caxis.axis || controller_mouse.controller_axes.y == event.caxis.axis)) {
432  if(controller_mouse.controller_axes.x == event.caxis.axis)
433  controller_mouse.velocity.x = event.caxis.value;
434  else
435  controller_mouse.velocity.y = event.caxis.value;
436  }
437  else
438  on_event(event);
439  }
440  else if(event.type == SDL_CONTROLLERBUTTONDOWN || event.type == SDL_CONTROLLERBUTTONUP) {
441  if(controller_mouse.enabled && get_Controllers().get_controller_index(event.cbutton.which) == 0 && controller_mouse.left_click == event.cbutton.button) {
442  SDL_Event e;
443 
445  e.common.timestamp = event.common.timestamp;
446  e.button.which = event.cbutton.which + 1;
447  e.button.state = event.cbutton.state;
449 
450  Sint32 x, y;
451  SDL_GetMouseState(&x, &y);
452  e.button.x = x;
453  e.button.y = y;
454 
455  on_event(e);
456  }
457  else if(controller_mouse.enabled && get_Controllers().get_controller_index(event.cbutton.which) == 0 && controller_mouse.escape == event.jbutton.button) {
458  SDL_Event e;
459 
460  e.common.type = event.common.type == SDL_CONTROLLERBUTTONDOWN ? SDL_KEYDOWN : SDL_KEYUP;
461  e.common.timestamp = event.common.timestamp;
464  e.key.state = event.cbutton.state;
466  //e.key.keysym.unicode = 0;
467 
468  on_event(e);
469  }
470  else if(controller_mouse.enabled && event.cbutton.which == 0 && (controller_mouse.scroll_down == event.jbutton.button || controller_mouse.scroll_up == event.jbutton.button)) {
471  SDL_Event e;
472 
474  e.common.timestamp = event.common.timestamp;
475  e.wheel.which = event.cbutton.which + 1;
476  e.wheel.windowID = 0;
477  e.wheel.x = 0;
478  e.wheel.y = controller_mouse.scroll_down == event.cbutton.button ? -1 : 1;
479 
480  on_event(e);
481  }
482  else
483  on_event(event);
484  }
485  else {
486  on_event(event);
487 
488  if(event.type == SDL_QUIT)
489  throw Quit_Event();
490  }
491  }
492 #endif
493 
494 #ifdef TEST_NASTY_CONDITIONS
495  {
496  const Time current_time;
497  const Time::Second_Type time_passed = time_scale * current_time.get_seconds_since(start_time);
498  size_t step_count = 0u;
499  while(time_used + (1 / 60.0f) < time_passed) {
500  time_used += (1 / 60.0f);
501  perform_logic();
502  if(++step_count == NASTY_RATE_CUTOFF)
503  time_used = time_passed;
504  }
506  perform_logic();
507  }
508 #else
509  perform_logic();
510 #endif
511 
512  get_Sound().update();
514 
515  if(Window::is_enabled()) {
516  Video &vr = get_Video();
517 
518 #ifndef DISABLE_DX9
519  try
520 #endif
521  {
522  if(vr.begin_prerender()) {
523  prerender();
524 
525  if(vr.begin_render()) {
526  try {
527  render();
528  }
529  catch(...) {
530  vr.end_render();
531  throw;
532  }
533 
534  vr.end_render();
535  }
536  }
537  }
538 #ifndef DISABLE_DX9
539  catch(Video_Device_Failure &) {
540  Video::destroy();
541  }
542 #endif
543  }
544  }
545  }
546 
547  void Game::push_Popup_Menu_State() {
548  push_state((*m_popup_menu_state_factory)());
549  }
550 
551  void Game::push_Popup_Pause_State() {
552  push_state((*m_popup_pause_state_factory)());
553  }
554 
555  void Game::replace_Popup_Menu_State_Factory(Popup_Menu_State_Factory * const popup_menu_state_factory) {
556  assert(popup_menu_state_factory);
557  delete m_popup_menu_state_factory;
558  m_popup_menu_state_factory = popup_menu_state_factory;
559  }
560 
561  void Game::replace_Popup_Pause_State_Factory(Popup_Pause_State_Factory * const popup_pause_state_factory) {
562  assert(popup_pause_state_factory);
563  delete m_popup_pause_state_factory;
564  m_popup_pause_state_factory = popup_pause_state_factory;
565  }
566 
567  void Game::calculate_fps() {
568  ++fps_next;
569  const Time::Tick_Type tp = time.get_ticks_passed();
570  if(tp < ticks_passed)
571  return;
572  ticks_passed = tp + 1000;
573  fps = fps_next;
574  fps_next = 0;
575  }
576 
577 #if !defined(ANDROID) && !defined(NDEBUG)
578  void Game::activate_console() {
579  if(!m_states.empty())
580  get_console().set_child(m_states.top());
581 
582  get_console().m_prompt.seek(get_console().m_prompt.get_max_seek());
583 
584  m_console_active = true;
585  }
586 
587  void Game::deactivate_console() {
588  m_console_active = false;
589  get_console().clear_child();
590  }
591 
592  Gamestate & Game::get_console_instance() {
593  static Gamestate console_state(Gamestate(new Console_State()));
594  return console_state;
595  }
596 #endif
597 
598  bool Game::is_console_active() const {
599 #if !defined(ANDROID) && !defined(NDEBUG)
600  return m_console_active;
601 #else
602  return false;
603 #endif
604  }
605 }
606 
607 #include <Zeni/Undefine.h>
SDL_JoystickID which
Definition: SDL_events.h:345
float frand_lte()
Get a random floating point number in the range [0.0f, 1.0f].
Definition: Random.h:64
Controllers & get_Controllers()
Get access to the singleton.
Definition: Controllers.cpp:59
static const int & get_width()
Get the size of the window.
Definition: Window.hxx:33
GLdouble s
Definition: glew.h:1376
void on_event(const SDL_Event &event)
Definition: Gamestate.hxx:80
SDL_ControllerAxisEvent caxis
Definition: SDL_events.h:511
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:141
The Video Rendering Singleton.
Definition: Video.h:71
SDL_ControllerDeviceEvent cdevice
Definition: SDL_events.h:513
Sound_Source_Pool & get_Sound_Source_Pool()
Get access to the singleton.
GLclampf f
Definition: glew.h:3390
Sint32 rand_lt(const Sint32 &mod)
Get a random integer in the range [0, mod)
Definition: Random.h:69
static GUI * gui
Definition: chat.cpp:52
EGLSurface EGLint x
Definition: eglext.h:293
void detect_removed()
Fix to broken SDL device removal detection.
DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event)
Polls for currently pending events.
Definition: SDL_events.c:415
return Display return Display Bool Bool int int e
Definition: SDL_x11sym.h:30
static void render(const Vertex_Buffer_Macrorenderer &macrorenderer, std::vector< Vertex_Buffer::Vertex_Buffer_Range * > &descriptors)
SDL_Scancode scancode
Definition: SDL_keyboard.h:49
The SDL keysym structure, used in key events.
Definition: SDL_keyboard.h:47
#define NASTY_MAX_RATE
Definition: Define.h:90
#define assert(x)
Definition: SDL_malloc.c:1234
SDL_GameControllerButton
void device_added(const Sint32 &index)
Register a new device.
if(!yyg->yy_init)
#define NASTY_ZERO_STEP_FREQUENCY
Definition: Define.h:92
SDL_JoystickID which
Definition: SDL_events.h:362
SDL_MouseWheelEvent wheel
Definition: SDL_events.h:505
Game & get_Game()
Get access to the singleton.
Definition: Game.cpp:58
The Gamestate Stack.
Definition: Game.h:71
virtual bool begin_prerender()=0
Must be called before begin_render.
static long get_time(void)
Definition: test_bbox.c:16
A Random Number Generator.
Definition: Random.h:40
DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y)
Retrieve the current state of the mouse.
Definition: SDL_mouse.c:382
float Second_Type
Definition: Timer.h:66
void update()
Redistribute hardware Sound_Sources according to the Replacement_Policy. Newer Sound_Sources are impl...
Sound & get_Sound()
Get access to the singleton.
Definition: Sound.cpp:220
Timer & get_Timer()
Get access to the singleton.
Definition: Timer.cpp:73
ALuint u
Definition: alMain.h:58
Sint32 get_controller_index(const Sint32 &id) const
Get the index of a given controller from the true SDL_JoystickInstanceID.
Definition: Controllers.cpp:67
int
Definition: SDL_systhread.c:37
#define SDL_BUTTON_LEFT
Definition: SDL_mouse.h:204
int g_argc
Definition: Game.cpp:32
A smartpointer for a Gamestate_Base.
Definition: Gamestate.h:169
#define END_OF_TIME
Definition: Define.h:133
DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window *window)
Get the numeric ID of a window, for logging purposes.
Definition: SDL_video.c:1385
SDL_Keysym keysym
Definition: SDL_events.h:185
local int destroy(gz_stream *s)
Definition: gzio.c:355
Gamestate_Zero_Initializer * g_gzi
Definition: Game.cpp:31
A class to signal that the program is quitting.
Definition: Quit_Event.h:37
size_t Tick_Type
Definition: Timer.h:65
#define NASTY_MIN_RATE
Definition: Define.h:89
const char *const * g_argv
Definition: Game.cpp:33
Window & get_Window()
Get access to the singleton.
Definition: Window.cpp:392
EGLSurface EGLint EGLint y
Definition: eglext.h:293
Uint16 mod
Definition: SDL_keyboard.h:51
virtual bool begin_render()=0
Must be called before all rendering functions; Returns true if rendering can proceed.
DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window *window, int x, int y)
Moves the mouse to the given position within the window.
Definition: SDL_mouse.c:412
SDL_KeyboardEvent key
Definition: SDL_events.h:500
#define memcpy
Definition: SDL_malloc.c:634
float get_seconds_since(const Time &time) const
Get the number of seconds passed between &#39;time&#39; and this Time.
Definition: Timer.hxx:44
SDL_ControllerButtonEvent cbutton
Definition: SDL_events.h:512
static const int & get_height()
Get the height of the window.
Definition: Window.hxx:37
Uint32 timestamp
Definition: SDL_events.h:154
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:133
SDL_Keycode sym
Definition: SDL_keyboard.h:50
#define NASTY_RATE_CUTOFF
Definition: Define.h:91
SDL_MouseButtonEvent button
Definition: SDL_events.h:504
void write_to_log(const String &text)
void perform_logic()
Definition: Gamestate.hxx:85
virtual void end_render()=0
Must be called after all rendering functions.
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:137
General event structure.
Definition: SDL_events.h:495
Provide a text console to process commands.
Definition: Console_State.h:48
Video & get_Video()
Get access to the singleton.
Definition: Video.cpp:149
#define min(x, y)
Definition: os.h:75
SDL_CommonEvent common
Definition: SDL_events.h:498
void prerender()
Definition: Gamestate.hxx:89
#define max(x, y)
Definition: os.h:79
A 2D Point represented with floats.
Definition: Coordinate.h:98
DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void)
Get the current key modifier state for the keyboard.
Definition: SDL_keyboard.c:843
SDL_GameControllerAxis
void update()
Update background music, as needed.
Definition: Sound.hxx:82
#define false
Definition: ftrandom.c:50
Uint32 type
Definition: SDL_events.h:497
cl_event event
Definition: glew.h:3556
A Snapshot of the Timer.
Definition: Timer.h:63