Client.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef CLIENT_H
  2. #define CLIENT_H
  3. #include "../engine/Wrapper.h"
  4. #include "../engine/KeyManager.h"
  5. #include "../engine/MouseManager.h"
  6. #include "../engine/Clock.h"
  7. #include "../engine/Shader.h"
  8. #include "../engine/DirectRenderer.h"
  9. using namespace std;
  10. class Client : public IClient
  11. {
  12. public:
  13. Client();
  14. virtual ~Client();
  15. void tick() override;
  16. void renderTick(float lag) override;
  17. void onKeyEvent(int key, int scancode, int action, int mods) override;
  18. void onMouseClick(int button, int action, int mods) override;
  19. private:
  20. static const int KEY_LEFT = 0;
  21. static const int KEY_RIGHT = 1;
  22. static const int KEY_UP = 2;
  23. static const int KEY_DOWN = 3;
  24. static const int KEY_JUMP = 4;
  25. static const int KEY_SNEAK = 5;
  26. static const int KEY_CAM_LEFT = 6;
  27. static const int KEY_CAM_RIGHT = 7;
  28. static const int KEY_CAM_UP = 8;
  29. static const int KEY_CAM_DOWN = 9;
  30. static const int MOUSE_LEFT = 0;
  31. Clock tps;
  32. Clock fps;
  33. KeyManager keyManager;
  34. MouseManager mouseManager;
  35. Shader shader;
  36. DirectRenderer directRenderer;
  37. Vector3D position;
  38. float lengthAngle = 0;
  39. float widthAngle = 0;
  40. };
  41. #endif