From 855da86feae1a5cc14dc2d486ccf115f484dbc2e Mon Sep 17 00:00:00 2001 From: rtk0c Date: Mon, 25 Apr 2022 20:22:07 -0700 Subject: Changeset: 16 Initial work on rendering sprites to screen --- source/SceneThings.hpp | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'source/SceneThings.hpp') 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 #include -class BuildingObject : public GameObject { +class SimpleGeometryObject : public GameObject { private: - RcPtr mMesh; - RcPtr 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 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 GetRenderObjects() const override; }; -- cgit v1.2.3-70-g09d2