better timing
This commit is contained in:
parent
59b6e2779f
commit
4baeca1603
4 changed files with 56 additions and 20 deletions
|
|
@ -45,6 +45,7 @@ import Crafter.Event;
|
|||
|
||||
export namespace Crafter {
|
||||
class Transform;
|
||||
class RenderingElement;
|
||||
class Window {
|
||||
public:
|
||||
std::uint_fast32_t width;
|
||||
|
|
@ -68,6 +69,16 @@ export namespace Crafter {
|
|||
void ScaleElement(Transform& element);
|
||||
void ScaleMouse(Transform& element, Transform& parent);
|
||||
void ScaleMouse(Transform& element);
|
||||
#ifdef CRAFTER_TIMING
|
||||
std::chrono::nanoseconds totalUpdate;
|
||||
std::vector<std::pair<const EventListener<FrameTime>*, std::chrono::nanoseconds>> updateTimings;
|
||||
std::chrono::nanoseconds totalRender;
|
||||
std::vector<std::tuple<const RenderingElement*, std::uint_fast32_t, std::uint_fast32_t, std::chrono::nanoseconds>> renderTimings;
|
||||
std::chrono::nanoseconds vblank;
|
||||
std::chrono::nanoseconds totalFrame;
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> frameEnd;
|
||||
void LogTiming();
|
||||
#endif
|
||||
};
|
||||
|
||||
class WindowKeyboard {
|
||||
|
|
@ -145,6 +156,7 @@ export namespace Crafter {
|
|||
xkb_keymap* xkb_keymap;
|
||||
xkb_context* xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||
xkb_state* xkb_state;
|
||||
void RenderElement(Transform* transform);
|
||||
void Render() override;
|
||||
void StartSync() override;
|
||||
void StartUpdate() override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue