From fe5512712925cc155db3039649cc00aa2634b8f8 Mon Sep 17 00:00:00 2001 From: thecssdoom <88057782+thecssdoom@users.noreply.github.com> Date: Sun, 9 Oct 2022 22:01:36 -0300 Subject: [PATCH 1/5] add rendername --- src/include/DataModelV2/Instance.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/include/DataModelV2/Instance.h b/src/include/DataModelV2/Instance.h index b8009bd..532a1f1 100644 --- a/src/include/DataModelV2/Instance.h +++ b/src/include/DataModelV2/Instance.h @@ -13,6 +13,7 @@ public: virtual ~Instance(void); std::string name; virtual void render(RenderDevice*); + virtual void renderName(RenderDevice*); virtual void update(); std::vector children; // All children. std::string getClassName(); From 00e61d4f17a591f9632f52aef46242e37cf2084f Mon Sep 17 00:00:00 2001 From: thecssdoom <88057782+thecssdoom@users.noreply.github.com> Date: Sun, 9 Oct 2022 22:04:38 -0300 Subject: [PATCH 2/5] Update Instance.cpp --- src/source/DataModelV2/Instance.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/source/DataModelV2/Instance.cpp b/src/source/DataModelV2/Instance.cpp index 4cb1279..ed2d162 100644 --- a/src/source/DataModelV2/Instance.cpp +++ b/src/source/DataModelV2/Instance.cpp @@ -33,6 +33,14 @@ void Instance::render(RenderDevice* rd) } } +void Instance::renderName(RenderDevice* rd) +{ + for(size_t i = 0; i < children.size(); i++) + { + children[i]->renderName(rd); + } +} + void Instance::update() { } From 20e772f932381742b9bc2dfe83ac64cd0f3a1aa9 Mon Sep 17 00:00:00 2001 From: thecssdoom <88057782+thecssdoom@users.noreply.github.com> Date: Sun, 9 Oct 2022 22:05:09 -0300 Subject: [PATCH 3/5] Update PartInstance.h --- src/include/DataModelV2/PartInstance.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/DataModelV2/PartInstance.h b/src/include/DataModelV2/PartInstance.h index 90f9f58..5d8715b 100644 --- a/src/include/DataModelV2/PartInstance.h +++ b/src/include/DataModelV2/PartInstance.h @@ -16,6 +16,7 @@ public: //Rendering virtual void PartInstance::postRender(RenderDevice* rd); virtual void render(RenderDevice*); + virtual void renderName(RenderDevice*); //Surfaces Enum::SurfaceType::Value top; @@ -76,4 +77,4 @@ private: bool dragging; Box itemBox; GLuint glList; -}; \ No newline at end of file +}; From 5078b849b07a5f6657e0675f75c354f99fcb6ad8 Mon Sep 17 00:00:00 2001 From: thecssdoom <88057782+thecssdoom@users.noreply.github.com> Date: Sun, 9 Oct 2022 22:06:01 -0300 Subject: [PATCH 4/5] Update PartInstance.cpp --- src/source/DataModelV2/PartInstance.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/source/DataModelV2/PartInstance.cpp b/src/source/DataModelV2/PartInstance.cpp index 87bf613..b33e9b7 100644 --- a/src/source/DataModelV2/PartInstance.cpp +++ b/src/source/DataModelV2/PartInstance.cpp @@ -70,6 +70,11 @@ void PartInstance::setRotVelocity(Vector3 v) } void PartInstance::postRender(RenderDevice *rd) +{ + // possibly descard this function... +} + +void PartInstance::renderName(RenderDevice *rd) { if(!nameShown) return; From fb5d6495dc6f453d8428fcd1969e7fb9bc9c991e Mon Sep 17 00:00:00 2001 From: thecssdoom <88057782+thecssdoom@users.noreply.github.com> Date: Sun, 9 Oct 2022 22:06:55 -0300 Subject: [PATCH 5/5] Update Application.cpp --- src/source/Application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/source/Application.cpp b/src/source/Application.cpp index 5a7d908..b76a100 100644 --- a/src/source/Application.cpp +++ b/src/source/Application.cpp @@ -548,6 +548,7 @@ void Application::onGraphics(RenderDevice* rd) { glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); _dataModel->getWorkspace()->render(rd); + _dataModel->getWorkspace()->renderName(rd); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); @@ -757,4 +758,4 @@ void Application::QuitApp() void Application::onCreate(HWND parentWindow) { -} \ No newline at end of file +}