X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Finterface.hpp;fp=src%2Finterface.hpp;h=ed417086504a8f8b86d97f648abe4349d3692e83;hb=c3c5045f06327db2a3c97eae77a072bc06677286;hp=0000000000000000000000000000000000000000;hpb=119a7b6a7fdea2d501fc7b3410ffb22f72e8a1b8;p=blank.git diff --git a/src/interface.hpp b/src/interface.hpp new file mode 100644 index 0000000..ed41708 --- /dev/null +++ b/src/interface.hpp @@ -0,0 +1,65 @@ +#ifndef BLANK_INTERFACE_HPP_ +#define BLANK_INTERFACE_HPP_ + +#include "block.hpp" +#include "controller.hpp" +#include "hud.hpp" +#include "model.hpp" +#include "shader.hpp" + +#include + + +namespace blank { + +class Chunk; +class World; + +class Interface { + +public: + explicit Interface(World &); + + void Handle(const SDL_KeyboardEvent &); + void Handle(const SDL_MouseMotionEvent &); + void Handle(const SDL_MouseButtonEvent &); + void Handle(const SDL_MouseWheelEvent &); + void Handle(const SDL_WindowEvent &); + + void PickBlock(); + void PlaceBlock(); + void RemoveBlock(); + + void SelectNext(); + void SelectPrevious(); + + void Update(int dt); + + void Render(DirectionalLighting &); + +private: + World &world; + FPSController ctrl; + HUD hud; + + Chunk *aim_chunk; + int aim_block; + glm::vec3 aim_normal; + + OutlineModel outline; + glm::mat4 outline_transform; + + float move_velocity; + float pitch_sensitivity; + float yaw_sensitivity; + + Block remove; + Block selection; + + bool front, back, left, right, up, down; + +}; + +} + +#endif