From a556b45abf18f1bd509daaf63b66b7d55e9fd291 Mon Sep 17 00:00:00 2001 From: jjesswan Date: Mon, 22 Apr 2024 21:56:26 -0400 Subject: add engine version --- engine-ocean/Game/Components/drawcomponent.h | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 engine-ocean/Game/Components/drawcomponent.h (limited to 'engine-ocean/Game/Components/drawcomponent.h') diff --git a/engine-ocean/Game/Components/drawcomponent.h b/engine-ocean/Game/Components/drawcomponent.h new file mode 100644 index 0000000..94f4b21 --- /dev/null +++ b/engine-ocean/Game/Components/drawcomponent.h @@ -0,0 +1,41 @@ +#ifndef DRAWCOMPONENT_H +#define DRAWCOMPONENT_H + + +#include "Graphics/global.h" +#include +#include "Component.h" + +class DrawComponent : public Component +{ +public: + DrawComponent(std::shared_ptr shape); + DrawComponent(std::shared_ptr shape, std::string shape_name); + + // for materials, with multiple shape parts + DrawComponent(std::vector> shapes); + + + void draw(const std::shared_ptr &entity_mt); + void addMaterial(std::string material_name, std::string material_filepath); + std::shared_ptr getMaterial(); + std::shared_ptr getShape(); + std::vector> getShapesWithMaterials(); + bool objHasMaterial(); + bool objHasMultipleShapes(); + + std::string getShapeName(); + +private: + std::shared_ptr m_shape; + std::vector> m_shapes; + + std::string m_material_name; + bool hasMaterial = false; + std::string m_shape_name = "empty"; + + bool hasMultipleShapes = false; + +}; + +#endif // DRAWCOMPONENT_H -- cgit v1.2.3-70-g09d2