Blamite Game Engine - Blam (Core)
dx11_window.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../../debug_ui.h"
4 
6 {
14  {
15  private:
16  bool show_another_window = false;
17  bool show_test_window = false;
18 
19  public:
24 
29 
36  {
37  return &show_test_window;
38  }
39 
43  void Draw()
44  {
46  // Begin Built-in ImGui testing windows //
48 
49  //Show a simple window
50  // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug"
51  if (show)
52  {
53  static float f = 0.0f;
54  ImGui::Text("Hello, world!");
55  ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
56  ImGui::ColorEdit3("clear color", (float*)BlamRendering::DirectX::GetClearColor());
57  if (ImGui::Button("Test Window")) show_test_window ^= 1;
58  if (ImGui::Button("Render Clearing")) *BlamRendering::DirectX::RenderTargetClearing() ^= 1;
59  if (ImGui::Checkbox("Read-only", BlamRendering::DirectX::RenderTargetClearing()));
60  if (ImGui::Button("Another Window")) show_another_window ^= 1;
61  if (ImGui::Button("Menu Bar")) *duigvs(devtools_bar) ^= 1;
62  /*if (ImGui::Button("Render Clearing")) enable_render_target_clear ^= 1;*/
63  ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
64  }
65 
66  //Show another simple window, this time using an explicit Begin/End pair
67  if (show_another_window)
68  {
69  ImGui::SetNextWindowSize(ImVec2(200, 100)/*, ImGuiSetCond_FirstUseEver*/);
70  ImGui::Begin("Another Window", &show_another_window);
71  ImGui::Text("Hello");
72  ImGui::End();
73  }
74 
75  //Show the ImGui test window. Most of the sample code is in ImGui::ShowTestWindow()
76  if (show_test_window)
77  {
78  //ImGui::SetNextWindowPos(ImVec2(650, 20)/*, ImGuiSetCond_FirstUseEver*/); // Normally user code doesn't need/want to call it because positions are saved in .ini file anyway. Here we just want to make the demo initial state a bit more friendly!
79  //ImGui::ShowTestWindow(&show_test_window);
80  ImGui::ShowDemoWindow(&show_test_window);
81  }
82 
84  // END Built-in ImGui testing windows //
86  }
87  };
88 }
BlamRendering::DirectX::GetClearColor
BLAM ImVec4 * GetClearColor()
Retrieves the current color used to clear the render target.
Definition: render_manage.cpp:602
Blam::DebugUI::Windows::DirectX11Window::ShowTestWindow
bool * ShowTestWindow()
Retrieves whether or not the window should be drawn.
Definition: dx11_window.hpp:35
Blam::DebugUI::Windows::DirectX11Window
Class for the default ImGUI DX11 sample window.
Definition: dx11_window.hpp:13
Blam::DebugUI::devtools_bar
@ devtools_bar
Definition: debug_ui.h:363
Blam::DebugUI::ImGUIDrawingGroup::show
bool show
Controls whether or not the group should be shown. May not be used in all groups.
Definition: debug_ui.h:441
Blam::DebugUI::Windows::DirectX11Window::Draw
void Draw()
Draws the window, as well as the demo window and the "Another Window" if they are enabled.
Definition: dx11_window.hpp:43
Blam::DebugUI::ImGUIDrawingGroup
Class representing an ImGUI drawing group/draw list item.
Definition: debug_ui.h:408
Blam::DebugUI::Windows::DirectX11Window::DirectX11Window
DirectX11Window()
Unused constructor.
Definition: dx11_window.hpp:23
Blam::DebugUI::Windows
Legacy namespace to contain data for the legacy ImGUI console.
Definition: debug_ui.h:493
Text
@ Text
Master text object that wraps around both BitmapText and DWText.
Definition: render_stack.h:73
Blam::DebugUI::Windows::DirectX11Window::~DirectX11Window
~DirectX11Window()
Unused destructor.
Definition: dx11_window.hpp:28
BlamRendering::DirectX::RenderTargetClearing
BLAM bool * RenderTargetClearing()
Retrieves whether or not to enable render target clearing.
Definition: render_manage.cpp:597
duigvs
#define duigvs(x)
Macro for Blam::DebugUI::GetVisibility().
Definition: debug_ui.h:20