System.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 2018 Ortega Froysa, Nicolás <nortega@themusicinnoise.net>
  3. * Author: Ortega Froysa, Nicolás <nortega@themusicinnoise.net>
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU Affero General Public License as
  7. * published by the Free Software Foundation, either version 3 of the
  8. * License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Affero General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Affero General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #pragma once
  19. #include "Logger.hpp"
  20. #include "Shader.hpp"
  21. #include "AssetManager.hpp"
  22. #include <SDL2/SDL.h>
  23. #include <memory>
  24. #include <map>
  25. #include <GL/glew.h>
  26. #include <GL/gl.h>
  27. #include "Camera.hpp"
  28. class System {
  29. public:
  30. System();
  31. ~System();
  32. void run();
  33. static std::unique_ptr<Logger> logger;
  34. private:
  35. void syncInputs();
  36. int board[3][3];
  37. bool xturn;
  38. int tempx;
  39. int tempy;
  40. AssetManager asset_mngr;
  41. SDL_Window *window;
  42. SDL_GLContext glcontext;
  43. std::map<std::string, Shader> shaders;
  44. Camera cam;
  45. bool running;
  46. int CheckWin();
  47. void handleKey(SDL_Keysym key);
  48. };