Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
get.h
1 #pragma once
2 
3 #include "util/shared_ptr.h"
4 #include "util/weak_ptr.h"
5 
6 namespace blowbox
7 {
8  class GLFWManager;
9  class BlowboxCore;
10  class Window;
11  class ForwardRenderer;
12  class DeferredRenderer;
13  class CommandManager;
14  class CommandContextManager;
15  class Device;
16  class SwapChain;
17  class DescriptorHeap;
18  class ImGuiManager;
19  class SceneManager;
20  class DebugMenu;
21  class Console;
22  class Time;
23  class PerformanceProfiler;
24  class MemoryProfiler;
25  class FrameStats;
26  class MemoryStats;
27 
44  class Get
45  {
46  friend class BlowboxCore;
47  protected:
52  Get();
53 
58  ~Get();
59 
61  void Finalize();
62 
63  public:
65  static BlowboxCore* BlowboxCore();
66 
69 
72 
75 
78 
81 
84 
86  static SharedPtr<Device> Device();
87 
90 
93 
96 
99 
102 
105 
108 
110  static SharedPtr<Console> Console();
111 
113  static SharedPtr<Time> Time();
114 
117 
120 
123 
126 
127  protected:
133  void Set(blowbox::BlowboxCore* blowbox_core);
134 
140  void Set(SharedPtr<blowbox::GLFWManager> glfw_manager);
141 
147  void Set(SharedPtr<blowbox::Window> main_window);
148 
154  void Set(SharedPtr<blowbox::ForwardRenderer> forward_renderer);
155 
161  void Set(SharedPtr<blowbox::DeferredRenderer> deferred_renderer);
162 
168  void Set(SharedPtr<blowbox::CommandContextManager> command_context_manager);
169 
175  void Set(SharedPtr<blowbox::CommandManager> command_manager);
176 
182  void Set(SharedPtr<blowbox::Device> device);
183 
190 
197 
204 
210  void Set(SharedPtr<blowbox::SwapChain> swap_chain);
211 
217  void Set(SharedPtr<blowbox::ImGuiManager> imgui_manager);
218 
224  void Set(SharedPtr<blowbox::SceneManager> scene_manager);
225 
231  void Set(SharedPtr<blowbox::DebugMenu> debug_menu);
232 
238  void Set(SharedPtr<blowbox::Console> console);
239 
245  void Set(SharedPtr<blowbox::Time> time);
246 
253 
260 
266  void Set(SharedPtr<blowbox::FrameStats> instance);
267 
273  void Set(SharedPtr<blowbox::MemoryStats> instance);
274 
275  static Get* instance_;
276 
277  private:
278  bool finalized_;
300  };
301 }
WeakPtr< blowbox::CommandManager > command_manager_
The CommandManager instance.
Definition: get.h:285
static SharedPtr< Window > MainWindow()
Definition: get.cc:67
Get()
Constructs the Get class.
Definition: get.cc:10
static SharedPtr< SwapChain > SwapChain()
Definition: get.cc:130
static SharedPtr< ImGuiManager > ImGuiManager()
Definition: get.cc:137
WeakPtr< blowbox::MemoryProfiler > memory_profiler_
The MemoryProfiler instance.
Definition: get.h:297
WeakPtr< blowbox::DebugMenu > debug_menu_
The DebugMenu instance.
Definition: get.h:293
static Get * instance_
The instance of the Get class.
Definition: get.h:275
static SharedPtr< CommandManager > CommandManager()
Definition: get.cc:95
Provides clean access to all subsystems.
Definition: get.h:44
static SharedPtr< DescriptorHeap > DsvHeap()
Definition: get.cc:116
The core of Blowbox.
Definition: blowbox_core.h:53
static SharedPtr< PerformanceProfiler > PerformanceProfiler()
Definition: get.cc:168
eastl::weak_ptr< T > WeakPtr
Typedef for wrapping the EASTL weak_ptr.
Definition: weak_ptr.h:14
WeakPtr< blowbox::DescriptorHeap > rtv_descriptor_heap_
DescriptorHeap for rtvs.
Definition: get.h:287
static SharedPtr< CommandContextManager > CommandContextManager()
Definition: get.cc:88
static SharedPtr< SceneManager > SceneManager()
Definition: get.cc:144
static SharedPtr< Time > Time()
Definition: get.cc:162
WeakPtr< blowbox::ForwardRenderer > forward_renderer_
The ForwardRenderer that is used to render stuff to the main Window.
Definition: get.h:282
void Set(blowbox::BlowboxCore *blowbox_core)
Sets the BlowboxCore instance.
Definition: get.cc:192
WeakPtr< blowbox::CommandContextManager > command_context_manager_
The CommandContextManager instance.
Definition: get.h:284
WeakPtr< blowbox::PerformanceProfiler > performance_profiler_
The PerformanceProfiler instance.
Definition: get.h:296
WeakPtr< blowbox::GLFWManager > glfw_manager_
The GLFWManager instance.
Definition: get.h:280
static SharedPtr< DeferredRenderer > DeferredRenderer()
Definition: get.cc:81
static SharedPtr< Console > Console()
Definition: get.cc:156
void SetRtvHeap(SharedPtr< blowbox::DescriptorHeap > heap)
Sets the DescriptorHeap instance for render target views.
Definition: get.cc:240
WeakPtr< blowbox::FrameStats > frame_stats_
The FrameStats instance.
Definition: get.h:298
static SharedPtr< DescriptorHeap > CbvSrvUavHeap()
Definition: get.cc:123
WeakPtr< blowbox::ImGuiManager > imgui_manager_
The ImGuiManager instance.
Definition: get.h:291
static BlowboxCore * BlowboxCore()
static SharedPtr< GLFWManager > GLFWManager()
Definition: get.cc:60
blowbox::BlowboxCore * blowbox_core_
The BlowboxCore instance.
Definition: get.h:279
WeakPtr< blowbox::Window > main_window_
The main Window instance.
Definition: get.h:281
void SetCbvSrvUavHeap(SharedPtr< blowbox::DescriptorHeap > heap)
Sets the DescriptorHeap instance for cbv/srv/uavs.
Definition: get.cc:252
static SharedPtr< MemoryProfiler > MemoryProfiler()
Definition: get.cc:174
WeakPtr< blowbox::Time > time_
The Time instance.
Definition: get.h:295
~Get()
Destructs the Get class.
Definition: get.cc:19
static SharedPtr< MemoryStats > MemoryStats()
Definition: get.cc:186
The main Blowbox namespace.
Definition: image.cc:8
static SharedPtr< DescriptorHeap > RtvHeap()
Definition: get.cc:109
static SharedPtr< Device > Device()
Definition: get.cc:102
WeakPtr< blowbox::DescriptorHeap > dsv_descriptor_heap_
DescriptorHeap for dsvs.
Definition: get.h:288
WeakPtr< blowbox::SceneManager > scene_manager_
The SceneManager instance.
Definition: get.h:292
static SharedPtr< FrameStats > FrameStats()
Definition: get.cc:180
eastl::shared_ptr< T > SharedPtr
Typedef for wrapping the EASTL shared_ptr.
Definition: shared_ptr.h:14
void SetDsvHeap(SharedPtr< blowbox::DescriptorHeap > heap)
Sets the DescriptorHeap instance for depth stencil views.
Definition: get.cc:246
static SharedPtr< ForwardRenderer > ForwardRenderer()
Definition: get.cc:74
void Finalize()
Checks if all systems are set. If any are missing, it will assert.
Definition: get.cc:25
bool finalized_
Whether the Get system has been finalized.
Definition: get.h:278
WeakPtr< blowbox::MemoryStats > memory_stats_
The MemoryStats instance.
Definition: get.h:299
WeakPtr< blowbox::SwapChain > swap_chain_
The SwapChain instance.
Definition: get.h:290
WeakPtr< blowbox::Console > console_
The Console instance.
Definition: get.h:294
static SharedPtr< DebugMenu > DebugMenu()
Definition: get.cc:150
WeakPtr< blowbox::Device > device_
The render Device instance.
Definition: get.h:286
WeakPtr< blowbox::DeferredRenderer > deferred_renderer_
The DeferredRenderer that is used to render stuff to the main Window.
Definition: get.h:283
WeakPtr< blowbox::DescriptorHeap > cbv_srv_uav_descriptor_heap_
DescriptorHeap for cbv/srv/uavs.
Definition: get.h:289