Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
RendererSubsystem.h
1#pragma once
2
3#include "Subsystem.h"
4
5struct GLFWwindow;
6
8{
9public:
10 RendererSubsystem(App* appOwner) : Subsystem(appOwner) {}
11
12public:
15 virtual int PreInit(int ArgC, char* ArgV[]) override;
16 virtual int Init() override;
17 virtual void PreTick(double deltaTime) override;
18 virtual void Tick(double deltaTime) override;
19 virtual void TickRendering(double deltaTime) override;
20 virtual void Exit() override;
21
22private:
23 int InitGLFW();
24 int InitImGui();
25
26 void SetDefaultWindowHints();
27
28private:
29 struct WindowGuard
30 {
31 WindowGuard() : m_window(nullptr) {}
32 WindowGuard(int width, int height, const std::string& windowName);
33 ~WindowGuard();
34
35 // Add move operator
36 // This class should always own the window
37 WindowGuard(WindowGuard&& other) noexcept;
38 WindowGuard& operator=(WindowGuard&& other) noexcept;
39
40 // Delete the copy constructor and copy assignment operator to prevent
41 // copying
42 WindowGuard(const WindowGuard& other) = delete;
43 WindowGuard& operator=(const WindowGuard& other) = delete;
44
45 operator GLFWwindow*() const { return m_window; }
46 GLFWwindow* operator->() const { return m_window; }
47
48 GLFWwindow* m_window;
49 };
50
51private:
52 WindowGuard m_window;
53 std::string m_fontPath;
54};
Definition App.h:10
Definition RendererSubsystem.h:8
virtual void Tick(double deltaTime) override
Called every frame regardless of if the app is closing.
Definition RendererSubsystem.cpp:810
virtual void PreTick(double deltaTime) override
Runs before to tick to get if the app should close or set up a new frame.
Definition RendererSubsystem.cpp:794
virtual void TickRendering(double deltaTime) override
Called every frame if the app is NOT closing.
Definition RendererSubsystem.cpp:812
virtual int Init() override
Init the subsystem / start.
Definition RendererSubsystem.cpp:779
virtual void Exit() override
Called when closing the app.
Definition RendererSubsystem.cpp:833
virtual int PreInit(int ArgC, char *ArgV[]) override
Definition RendererSubsystem.cpp:89
Definition Subsystem.h:8