X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Finterface.hpp;h=9f43f4f6f662b6ba10b71d0706ebf5b202e9887b;hb=83ed3de28841d1eecfca39ff540e804cf6809b32;hp=16ee89f46c37313578d4ca41583c82b4672d01af;hpb=bee003d1d375789b6533cfd39c65f6d4478f1966;p=blank.git diff --git a/src/interface.hpp b/src/interface.hpp index 16ee89f..9f43f4f 100644 --- a/src/interface.hpp +++ b/src/interface.hpp @@ -3,9 +3,11 @@ #include "block.hpp" #include "controller.hpp" +#include "geometry.hpp" #include "hud.hpp" #include "model.hpp" #include "shader.hpp" +#include "timer.hpp" #include #include @@ -31,9 +33,11 @@ public: Interface(const Config &, World &); - void Handle(const SDL_KeyboardEvent &); + void HandlePress(const SDL_KeyboardEvent &); + void HandleRelease(const SDL_KeyboardEvent &); void Handle(const SDL_MouseMotionEvent &); - void Handle(const SDL_MouseButtonEvent &); + void HandlePress(const SDL_MouseButtonEvent &); + void HandleRelease(const SDL_MouseButtonEvent &); void Handle(const SDL_MouseWheelEvent &); void Handle(const SDL_WindowEvent &) noexcept; @@ -57,11 +61,15 @@ public: void Render(DirectionalLighting &) noexcept; +private: + void CheckAim(); + private: World &world; FPSController ctrl; HUD hud; + Ray aim; Chunk *aim_chunk; int aim_block; glm::vec3 aim_normal; @@ -71,6 +79,9 @@ private: Config config; + IntervalTimer place_timer; + IntervalTimer remove_timer; + Block remove; Block selection;