diff --git a/Application.cpp b/Application.cpp index 75f6064..f2062ae 100644 --- a/Application.cpp +++ b/Application.cpp @@ -620,7 +620,7 @@ void Application::onGraphics(RenderDevice* rd) { sky->renderLensFlare(renderDevice, lighting); } renderDevice->push2D(); - _dataModel->getGuiRoot()->renderGUI(renderDevice); + _dataModel->getGuiRoot()->renderGUI(renderDevice, m_graphicsWatch.FPS()); rd->pushState(); rd->beforePrimitive(); diff --git a/GuiRoot.cpp b/GuiRoot.cpp index 3be4cb1..02036c6 100644 --- a/GuiRoot.cpp +++ b/GuiRoot.cpp @@ -386,7 +386,7 @@ void GuiRoot::setDebugMessage(std::string msg, G3D::RealTime msgTime) //void GuiRoot::render(G3D::RenderDevice* renderDevice) {} -void GuiRoot::renderGUI(G3D::RenderDevice* rd) +void GuiRoot::renderGUI(G3D::RenderDevice* rd, double fps) { //TODO--Move these to their own instance @@ -398,8 +398,8 @@ void GuiRoot::renderGUI(G3D::RenderDevice* rd) #ifdef _DEBUG stream.str(""); stream.clear(); - stream << std::fixed << std::setprecision(3) << m_graphicsWatch.FPS(); - fntdominant->draw2D(rd, "FPS: " + stream.str(), Vector2(120, 25), 10, Color3::fromARGB(0xFFFF00), Color3::black()); + stream << std::fixed << std::setprecision(3) << fps; + g_fntdominant->draw2D(rd, "FPS: " + stream.str(), Vector2(120, 25), 10, Color3::fromARGB(0xFFFF00), Color3::black()); #endif //GUI Boxes Draw::box(G3D::Box(Vector3(0,25,0),Vector3(80,355,0)),rd,Color4(0.6F,0.6F,0.6F,0.4F), Color4(0,0,0,0)); diff --git a/GuiRoot.h b/GuiRoot.h index 48a3ce0..546c5b5 100644 --- a/GuiRoot.h +++ b/GuiRoot.h @@ -12,7 +12,7 @@ public: TextButtonInstance* makeTextButton(); void drawButtons(RenderDevice* rd); ImageButtonInstance* makeImageButton(G3D::TextureRef newImage, G3D::TextureRef overImage, G3D::TextureRef downImage, G3D::TextureRef disableImage); - void renderGUI(G3D::RenderDevice* rd); + void renderGUI(G3D::RenderDevice* rd, double fps); void setDebugMessage(std::string msg, G3D::RealTime msgTime); void update(); bool mouseInGUI(G3D::RenderDevice* renderDevice,int x,int y);