From f6890e8077133b5dd2cc0a92270d2a328d6c5ab9 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 8 Oct 2022 17:04:40 +0100 Subject: Initial commit of a basic working network editor --- ui/gameMainSelector.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ui/gameMainSelector.h') diff --git a/ui/gameMainSelector.h b/ui/gameMainSelector.h index e0715c9..04f2fd7 100644 --- a/ui/gameMainSelector.h +++ b/ui/gameMainSelector.h @@ -1,5 +1,6 @@ #pragma once +#include "SDL_events.h" #include "special_members.hpp" #include "uiComponent.h" #include @@ -7,20 +8,18 @@ #include class Ray; class UIShader; -union SDL_Event; class Camera; class GameMainSelector : public UIComponent { public: - class ClickReceiver { + class Component { public: - ClickReceiver() = default; - virtual ~ClickReceiver() = default; - DEFAULT_MOVE_COPY(ClickReceiver); + virtual ~Component() = default; - virtual void click(const Ray &) = 0; - virtual void move(const Ray &) = 0; - virtual bool handleMove() = 0; + virtual bool click(const SDL_MouseButtonEvent &, const Ray &); + virtual bool move(const SDL_MouseMotionEvent &, const Ray &); + virtual bool handleInput(const SDL_Event &, const Position & pos); + virtual void render(const UIShader & shader, const Position & pos) const; }; GameMainSelector(const Camera * c, glm::vec2 size); @@ -31,7 +30,7 @@ public: void defaultClick(const Ray & ray); - std::unique_ptr target; + std::unique_ptr target; private: const Camera * camera; -- cgit v1.2.3