GameClient.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef CLIENT_H
  2. #define CLIENT_H
  3. #include "common/utils/Types.h"
  4. namespace GameClient
  5. {
  6. void start(int width, int height, const char* windowName);
  7. }
  8. // these two are not needed here but prevent further errors
  9. /*#include <GL/glew.h>
  10. #include <GLFW/glfw3.h>
  11. #include "client/engine/KeyManager.h"
  12. #include "client/engine/MouseManager.h"
  13. #include "client/engine/Clock.h"
  14. #include "client/engine/Shader.h"
  15. #include "client/engine/DirectRenderer.h"
  16. #include "client/rendering/gui/GUIs.h"
  17. #include "client/rendering/gui/GUI.h"
  18. #include "common/world/IChunkProvider.h"
  19. using namespace std;
  20. class GameClient : public IClient
  21. {
  22. public:
  23. GameClient();
  24. virtual ~GameClient();
  25. void tick() override;
  26. void render3DTick(float lag) override;
  27. void render2DTick(float lag) override;
  28. void onKeyEvent(int key, int scancode, int action, int mods) override;
  29. void onMouseMove(double x, double y) override;
  30. void onMouseClick(int button, int action, int mods) override;
  31. private:
  32. double transformMouse(double in);
  33. static const int KEY_LEFT = 0;
  34. static const int KEY_RIGHT = 1;
  35. static const int KEY_UP = 2;
  36. static const int KEY_DOWN = 3;
  37. static const int KEY_JUMP = 4;
  38. static const int KEY_SNEAK = 5;
  39. static const int KEY_TEST = 10;
  40. static const int MOUSE_LEFT = 0;
  41. double oldMouseX = 0;
  42. double oldMouseY = 0;
  43. double diffMouseX = 0;
  44. double diffMouseY = 0;
  45. bool mouseTrapped = true;
  46. const double MOUSE_BORDER = 1.0;
  47. Clock tps;
  48. Clock fps;
  49. KeyManager keyManager;
  50. MouseManager mouseManager;
  51. Shader shader;
  52. DirectRenderer directRenderer;
  53. GUI* activeGUI = nullptr;
  54. };*/
  55. #endif