summaryrefslogtreecommitdiff
path: root/ui/gameMainSelector.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-10-08 17:04:40 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-10-08 17:04:40 +0100
commitf6890e8077133b5dd2cc0a92270d2a328d6c5ab9 (patch)
treee24cf13bf3e5d90409ed46a86f87668718e48fcf /ui/gameMainSelector.h
parentAdd collection methods for finding and/or creating objects (diff)
downloadilt-f6890e8077133b5dd2cc0a92270d2a328d6c5ab9.tar.bz2
ilt-f6890e8077133b5dd2cc0a92270d2a328d6c5ab9.tar.xz
ilt-f6890e8077133b5dd2cc0a92270d2a328d6c5ab9.zip
Initial commit of a basic working network editor
Diffstat (limited to 'ui/gameMainSelector.h')
-rw-r--r--ui/gameMainSelector.h17
1 files changed, 8 insertions, 9 deletions
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 <glm/glm.hpp>
@@ -7,20 +8,18 @@
#include <string>
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<ClickReceiver> target;
+ std::unique_ptr<Component> target;
private:
const Camera * camera;