Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
ProfilerWidget.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <GLFW/glfw3.h>
4#include <Common/Profiler.hpp>
5#include <UI/Widget.hpp>
6
7namespace shkyera {
8
9class ProfilerWidget : public Widget {
10 public:
11 using Widget::Widget;
12
13 ProfilerWidget(std::string name);
14
18 virtual void draw() override;
19
20 private:
21 void reset();
22
23 bool mResetOnEachFrame = false;
25 std::chrono::high_resolution_clock::time_point mTimeOfLastReset = std::chrono::high_resolution_clock::now();
26};
27
28} // namespace shkyera
Definition ProfilerWidget.hpp:9
virtual void draw() override
Implementation of the abstract draw method to render the profiler widget.
Definition ProfilerWidget.cpp:20
bool mResetOnEachFrame
Definition ProfilerWidget.hpp:23
std::chrono::high_resolution_clock::time_point mTimeOfLastReset
Definition ProfilerWidget.hpp:25
size_t mFramesSinceLastReset
Definition ProfilerWidget.hpp:24
void reset()
Definition ProfilerWidget.cpp:127
An abstract base class representing a GUI widget.
Definition Widget.hpp:23
Widget(std::string name)
Constructor to create a widget with a specified name.
Definition Widget.cpp:5
Definition Asset.hpp:6