gcsx_game.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* GCSx
  2. ** GAME.H
  3. **
  4. ** Game playing module- basic init, other top-level functionality
  5. */
  6. /*****************************************************************************
  7. ** Copyright (C) 2003-2006 Janson
  8. **
  9. ** This program is free software; you can redistribute it and/or modify
  10. ** it under the terms of the GNU General Public License as published by
  11. ** the Free Software Foundation; either version 2 of the License, or
  12. ** (at your option) any later version.
  13. **
  14. ** This program is distributed in the hope that it will be useful,
  15. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ** GNU General Public License for more details.
  18. **
  19. ** You should have received a copy of the GNU General Public License
  20. ** along with this program; if not, write to the Free Software
  21. ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
  22. *****************************************************************************/
  23. #ifndef __GCSx_GAME_H_
  24. #define __GCSx_GAME_H_
  25. // Load a game; if successful, can start calling game loop
  26. // Initializes GL, all parts of game, etc.
  27. void gcsxGameplay(const std::string& gameFile) throw_File;
  28. // Close game; safe to call with no game running
  29. // Will exit GL if necessary
  30. void gcsxEndgame();
  31. // Game loop- self-regulates fps/time cycles
  32. // Don't call if no game loaded!
  33. // Uses SDL events/input
  34. // Returns values as follows-
  35. enum {
  36. GAME_EXIT = 1,
  37. GAME_MENU,
  38. GAME_CONSOLE,
  39. };
  40. int gcsxGameloop();
  41. // Game loop- same thing but as part of GUI
  42. // a) handles display slightly different
  43. // b) sends events to desktop instead of returning values
  44. // c) only recieves keyboard, mouse, quit, active events
  45. // d) should NOT look at events or keyboard/input unless keysOk
  46. // @TODO: discrepancy in above function receives resize events
  47. // and this one will have them go through the desktop
  48. void gcsxGameloopGui(int keysOk);
  49. #endif