Skip to content

Commit

Permalink
GRAPHICS: New renderer fps counter
Browse files Browse the repository at this point in the history
Display fps counter using shader render path, if enabled.
  • Loading branch information
mirv-sillyfish authored and DrMcCoy committed May 26, 2019
1 parent 0bcca67 commit d734750
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/graphics/aurora/fps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ void FPS::render(RenderPass pass) {
Text::render(pass);
}

void FPS::renderImmediate(const glm::mat4 &parentTransform) {
uint32 fps = GfxMan.getFPS();

if (fps != _fps) {
_fps = fps;

setText(Common::UString::format("%d fps", _fps));
}

Text::renderImmediate(parentTransform);
}

void FPS::notifyResized(int UNUSED(oldWidth), int UNUSED(oldHeight), int newWidth, int newHeight) {
float posX = -(newWidth / 2.0f);
float posY = -(newHeight / 2.0f);
Expand Down
2 changes: 2 additions & 0 deletions src/graphics/aurora/fps.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class FPS : public Text, public Events::Notifyable {
// Renderable
void render(RenderPass pass);

void renderImmediate(const glm::mat4 &parentTransform);

private:
uint32 _fps;

Expand Down

0 comments on commit d734750

Please sign in to comment.