OpenShaderDesigner 0.0.1
Loading...
Searching...
No Matches
Profiler.h
1// =====================================================================================================================
2// Copyright 2024 Medusa Slockbower
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14// =====================================================================================================================
15
16#ifndef PROFILER_H
17#define PROFILER_H
18
19#include <Core/EventSystem.h>
20#include <Core/Window.h>
21#include <Editor/EditorWindow.h>
22#include <Utility/Timer.h>
23
24namespace OpenShaderDesigner
25{
26
28 : public EditorWindow
29 , public EventHandler<BeginFrame>
30 , public EventHandler<EndFrame>
31 {
32 public:
33 Profiler();
34 ~Profiler();
35
36 void DrawWindow() override;
37
38 bool HandleEvent(const EventHandler<BeginFrame>::HandledType* event) override;
39 bool HandleEvent(const EventHandler<EndFrame>::HandledType* event) override;
40
41 private:
42 enum
43 {
44 EVENTS = 0
45 , RENDER
46 , EDITOR
47 , END
48
49 , COUNT
50 , LAST = COUNT - 1
51 };
52
53 uint64_t Frame;
54 double Deltas[COUNT];
56 };
57
58}
59
60
61
62#endif //PROFILER_H
EditorWindow class for wrapping ImGui window functionality.
Definition EditorWindow.h:28
EventHandler interface for creating custom EventHandlers.
Definition EventSystem.h:64
EventType HandledType
The type handled by the EventHandler.
Definition EventSystem.h:66
Definition Profiler.h:31
void DrawWindow() override
DrawWindow function for when the EditorWindow is being drawn.
Definition Profiler.cpp:35
Definition Timer.h:24