aboutsummaryrefslogtreecommitdiff
path: root/source/SceneThings.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-04-25 20:22:07 -0700
committerrtk0c <[email protected]>2022-04-25 20:22:07 -0700
commit855da86feae1a5cc14dc2d486ccf115f484dbc2e (patch)
tree8284c6a6bdfb1a919eb1a22f466f4180a329c7f3 /source/SceneThings.hpp
parentd78a55de5003dbb040f1d1c369409e63a2c806d8 (diff)
Changeset: 16 Initial work on rendering sprites to screen
Diffstat (limited to 'source/SceneThings.hpp')
-rw-r--r--source/SceneThings.hpp39
1 files changed, 30 insertions, 9 deletions
diff --git a/source/SceneThings.hpp b/source/SceneThings.hpp
index f8ad000..da551c0 100644
--- a/source/SceneThings.hpp
+++ b/source/SceneThings.hpp
@@ -1,21 +1,42 @@
#pragma once
+#include "Color.hpp"
#include "GameObject.hpp"
+#include "Renderer.hpp"
+#include <glm/glm.hpp>
#include <vector>
-class BuildingObject : public GameObject {
+class SimpleGeometryObject : public GameObject {
private:
- RcPtr<GpuMesh> mMesh;
- RcPtr<Material> mMaterial;
+ RenderObject mRenderObject;
+ glm::vec2 mSize;
+ RgbaColor mColor;
public:
- using GameObject::GameObject;
+ SimpleGeometryObject(GameWorld* world);
+
+ glm::vec2 GetSize() const { return mSize; }
+ void SetSize(glm::vec2 size);
+ RgbaColor GetColor() const { return mColor; }
+ void SetColor(RgbaColor color);
+ virtual std::span<const RenderObject> GetRenderObjects() const override;
+
+private:
+ void UpdateRenderObject();
+};
- virtual Tags::GameObjectType GetTypeTag() const override { return Tags::GOT_Building; }
+class BuildingObject : public GameObject {
+private:
+ RenderObject mRenderObject;
+
+public:
+ BuildingObject(GameWorld* world);
- void SetMeshMaterial(Material* material);
- virtual const Material* GetMeshMaterial() const override;
- void SetMesh(GpuMesh* mesh);
- virtual const GpuMesh* GetMesh() const override;
+ // TODO
+ // void SetMeshMaterial(Material* material);
+ // virtual const Material* GetMeshMaterial() const override;
+ // void SetMesh(GpuMesh* mesh);
+ // virtual const GpuMesh* GetMesh() const override;
+ virtual std::span<const RenderObject> GetRenderObjects() const override;
};