14 lines
447 B
C++
14 lines
447 B
C++
#pragma once
|
|
#include <cstdio>
|
|
#include "text_hud.h"
|
|
class fps_counter : public text_hud {
|
|
public:
|
|
fps_counter() : text_hud("fps counter", "shows your current fps", category::hud, VK_F6) {
|
|
label_ = "fps"; text_ = "0"; reserve_ = "000"; hud_pos = ImVec2(10, 10);
|
|
}
|
|
void on_render() override {
|
|
char value[24]; snprintf(value, sizeof(value), "%.0f", ImGui::GetIO().Framerate);
|
|
text_ = value; draw_text();
|
|
}
|
|
};
|