You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.7 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. #ifndef __BETACORE_GAME_HPP__
  2. #define __BETACORE_GAME_HPP__
  3. #ifdef _WIN32
  4. #define SDL_MAIN_HANDLED
  5. #include <Windows.h>
  6. #include <GLU.h>
  7. #include <GL/gl.h>
  8. #elif linux
  9. #include <GL/glu.h>
  10. #endif
  11. #include <SDL2/SDL.h>
  12. #include <SDL2/SDL_opengl.h>
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include <string>
  16. #include <math.h>
  17. #define PI 3.14159265359
  18. #include "../includes/common.hpp"
  19. namespace betacore
  20. {
  21. class Game
  22. {
  23. private:
  24. SDL_Window *WINDOW = NULL;
  25. SDL_GLContext glContext;
  26. const int SCREEN_WIDTH = 800;
  27. const int SCREEN_HEIGHT = 600;
  28. int MONITOR_WIDTH=1920;
  29. int MONITOR_HEIGHT=1080;
  30. const char *TITLE = "Lesson 01";
  31. bool KEEP_ALIVE = true;
  32. bool SHOW_GRID = false;
  33. SHAPE USER_CURRENT = TRIANGLE;
  34. SHAPE GUST_CURRENT = UNKOWN;
  35. bool KEY_UP_ARROW_ACTIVE = false;
  36. bool KEY_DOWN_ARROW_ACTIVE = false;
  37. bool KEY_LEFT_ARROW_ACTIVE = false;
  38. bool KEY_RIGHT_ARROW_ACTIVE = false;
  39. bool KEY_SPACE_ACTIVE = false;
  40. bool KEY_RETURN_ACTIVE = false;
  41. bool FULL_SCREEN = false;
  42. public:
  43. Game();
  44. ~Game();
  45. int init();
  46. int initGL();
  47. void box();
  48. void close();
  49. void grid();
  50. void paint();
  51. void events( SDL_Event &event );
  52. void key_down(SDL_Keycode key_code);
  53. void key_up(SDL_Keycode key_code);
  54. void resize ( int width, int height );
  55. void triangle();
  56. void triangle(bool filled);
  57. void square();
  58. void square(bool filled);
  59. void circle();
  60. void circle(bool filled);
  61. void pentagon();
  62. void pentagon(bool filled);
  63. void rectangle();
  64. void cross(bool filled);
  65. void compass();
  66. void on_key_up_arrow();
  67. void on_key_down_arrow();
  68. void on_key_left_arrow();
  69. void on_key_right_arrow();
  70. void on_key_space();
  71. void on_key_enter();
  72. void top_screen();
  73. void user_screen();
  74. void guest_screen();
  75. };
  76. } // namespace betacore
  77. #endif