diff --git a/src/include/DataModelV2/Instance.h b/src/include/DataModelV2/Instance.h index 7e25dce..be7eae1 100644 --- a/src/include/DataModelV2/Instance.h +++ b/src/include/DataModelV2/Instance.h @@ -12,6 +12,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(); diff --git a/src/source/Application.cpp b/src/source/Application.cpp index 1f31657..0e61e31 100644 --- a/src/source/Application.cpp +++ b/src/source/Application.cpp @@ -550,6 +550,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); @@ -759,4 +760,4 @@ void Application::QuitApp() void Application::onCreate(HWND parentWindow) { -} \ No newline at end of file +} diff --git a/src/source/DataModelV2/Instance.cpp b/src/source/DataModelV2/Instance.cpp index 98fceea..a83a9a8 100644 --- a/src/source/DataModelV2/Instance.cpp +++ b/src/source/DataModelV2/Instance.cpp @@ -30,6 +30,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() { } diff --git a/src/source/DataModelV2/PartInstance.cpp b/src/source/DataModelV2/PartInstance.cpp index 0cb6dbf..df70ce1 100644 --- a/src/source/DataModelV2/PartInstance.cpp +++ b/src/source/DataModelV2/PartInstance.cpp @@ -107,6 +107,11 @@ void PartInstance::setRotVelocity(Vector3 v) } void PartInstance::postRender(RenderDevice *rd) +{ + // possibly descard this function... +} + +void PartInstance::renderName(RenderDevice *rd) { if(!nameShown) return;