void ElevatorSimRenderWindow::drawFPS(int fps, int totalFrames) { std::stringstream renderStringStream( std::stringstream::in | std::stringstream::out); const int MAX_DIAG_STR_LEN = 256; char stringBuf[MAX_DIAG_STR_LEN]; glColor3f(0.0f, 1.f, 0.f); /* because green text is sexy text */ renderStringStream << "FPS: " << fps << std::endl; renderStringStream << "Total Frame: " << totalFrames << std::endl; renderStringStream.getline(stringBuf, MAX_DIAG_STR_LEN); drawText(stringBuf, 10.f, 10.f); renderStringStream.getline(stringBuf, MAX_DIAG_STR_LEN); drawText(stringBuf, 10.f, 20.f); }
void ElevatorSimRenderWindow::drawFPS() { std::stringstream renderStringStream( std::stringstream::in | std::stringstream::out); char stringBuf[256]; glColor3f(0.0f, 1.f, 0.f); /* because green text is sexy text */ renderStringStream << "FPS: " << timeManager.getFPS() << std::endl; renderStringStream << "Total Frame: " << timeManager.getTotalFrames() << std::endl; renderStringStream.getline(stringBuf, 256); drawText(stringBuf, 10.f, 10.f); renderStringStream.getline(stringBuf, 256); drawText(stringBuf, 10.f, 20.f); }