Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
imgui_manager.h
1 #pragma once
2 
3 #include "core/get.h"
4 #include "win32/window.h"
5 #include "win32/key_code.h"
6 #include "renderer/imgui/imgui.h"
7 #include "renderer/d3d12_includes.h"
8 #include "renderer/root_signature.h"
9 #include "renderer/pipeline_state.h"
10 #include "renderer/buffers/color_buffer.h"
11 #include "renderer/buffers/upload_buffer.h"
12 
13 namespace blowbox
14 {
23  {
24  public:
26  ImGuiManager();
27 
29  ~ImGuiManager();
30 
32  void Init();
33 
35  void NewFrame();
36 
38  void Render();
39 
41  void Shutdown();
42 
47  static void ImGuiRenderDrawLists(ImDrawData* draw_data);
48 
49  protected:
51  void CreateDeviceObjects();
52 
55 
56  private:
57  bool initialized_;
59  INT64 time_;
60 
61  ID3DBlob* vertex_shader_blob_;
62  D3D12_SHADER_BYTECODE vertex_shader_;
63 
64  ID3DBlob* pixel_shader_blob_;
65  D3D12_SHADER_BYTECODE pixel_shader_;
66 
70 
72  };
73 }
~ImGuiManager()
Destructs the ImGuiManager.
Definition: imgui_manager.cc:21
void Render()
Performs the actual rendering for ImGui.
Definition: imgui_manager.cc:118
Implements all ImGui functionality.
Definition: imgui_manager.h:22
Buffer-type for buffers with color data in them.
Definition: color_buffer.h:14
D3D12_SHADER_BYTECODE pixel_shader_
The pixel shader for imgui.
Definition: imgui_manager.h:65
Wraps the PipelineStateObject for graphics pipelines.
Definition: pipeline_state.h:61
RootSignature root_signature_
The rootsignature for imgui rendering.
Definition: imgui_manager.h:68
INT64 ticks_per_second_
Ticks per second (queried by QueryPerformanceFrequency)
Definition: imgui_manager.h:58
D3D12_SHADER_BYTECODE vertex_shader_
The vertex shader for imgui.
Definition: imgui_manager.h:62
UploadBuffer upload_buffer_
One large buffer for storing all vertex, index, constant buffer, etc. data.
Definition: imgui_manager.h:71
Wraps the ID3D12RootSignature object.
Definition: root_signature.h:121
ID3DBlob * vertex_shader_blob_
The vertex shader blob for imgui.
Definition: imgui_manager.h:61
void Shutdown()
Shuts down the ImGuiManager.
Definition: imgui_manager.cc:125
void CreateDeviceObjects()
Creates all device objects (shaders, pso, root signature, etc)
Definition: imgui_manager.cc:251
ImGuiManager()
Constructs the ImGuiManager.
Definition: imgui_manager.cc:12
void InvalidateDeviceObjects()
Destroys all device objects (shaders, pso, root signature, etc)
Definition: imgui_manager.cc:414
ColorBuffer texture_buffer_
The buffer for all texture data provided by imgui.
Definition: imgui_manager.h:69
GraphicsPSO pipeline_state_
The PSO for imgui rendering.
Definition: imgui_manager.h:67
The main Blowbox namespace.
Definition: image.cc:8
Wraps upload buffer types, which allow you to upload data to the GPU.
Definition: upload_buffer.h:19
static void ImGuiRenderDrawLists(ImDrawData *draw_data)
Renders all the ImGui data to the screen.
Definition: imgui_manager.cc:132
void NewFrame()
Prepares ImGui for a new frame.
Definition: imgui_manager.cc:58
void Init()
Initializes the ImGuiManager.
Definition: imgui_manager.cc:27
ID3DBlob * pixel_shader_blob_
The pixel shader blob for imgui.
Definition: imgui_manager.h:64
bool initialized_
Whether the ImGuiManager has been initialized.
Definition: imgui_manager.h:57
INT64 time_
Current time (queried by QueryPerformanceCounter)
Definition: imgui_manager.h:59