Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
dx11_window.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
12 {
13 private:
14  float f = 0.0f;
15 
16 public:
17  bool show_another_window = false;
18  bool show_test_window = false;
19 
23  void Draw()
24  {
25  if (show)
26  {
27  ImGui::Text("Hello, world!");
28  ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
29 
30  BlamColor* clear_color = Blam::Globals::GetGlobalAsColor("clear_col");
31  ImVec4 clear_col_imgui = ImVec4(clear_color->GetRedAsFloat(), clear_color->GetGreenAsFloat(), clear_color->GetBlueAsFloat(), clear_color->GetAlphaAsFloat());
32 
33  ImGui::ColorEdit3("clear color", (float*)&clear_col_imgui);
34 
35  BlamColor new_clear_color = BlamColor(clear_col_imgui.x * 255.0f, clear_col_imgui.y * 255.0f, clear_col_imgui.z * 255.0f, clear_col_imgui.w * 255.0f);
36 
37  Blam::Globals::UpdateGlobal("clear_col", new_clear_color);
38 
39  if (ImGui::Button("Test Window"))
40  {
42  }
43 
44  if (ImGui::Button("Render Clearing"))
45  {
46  //*BlamRendering::DirectX::RenderTargetClearing() ^= 1;
47  }
48 
49  //ImGui::Checkbox("Read-only", BlamRendering::DirectX::RenderTargetClearing());
50 
51  if (ImGui::Button("Another Window"))
52  {
54  }
55 
56  if (ImGui::Button("Menu Bar"))
57  {
58  bool devtools_bar_visibility = *Blam::UI::ImGUI::GetVisibility("devtools_bar");
59  devtools_bar_visibility = !devtools_bar_visibility;
60  }
61 
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 
67  {
68  ImGui::SetNextWindowSize(ImVec2(200, 100)/*, ImGuiSetCond_FirstUseEver*/);
69  ImGui::Begin("Another Window", &show_another_window);
70  ImGui::Text("Hello");
71  ImGui::End();
72  }
73 
74  if (show_test_window)
75  {
77  }
78  }
79 };
ImGui::ColorEdit3
IMGUI_API bool ColorEdit3(const char *label, float col[3], ImGuiColorEditFlags flags=0)
Definition: imgui_widgets.cpp:4146
BlamImGuiWindow_DirectX11Window::show_test_window
bool show_test_window
Toggles the built-in ImGUI Demo window.
Definition: dx11_window.hpp:18
BlamImGuiWindow::show
bool show
Controls whether or not the group should be shown. May not be used in all groups.
Definition: imgui.h:34
Blam::Globals::UpdateGlobal
BLAM BlamGlobalUpdateResult UpdateGlobal(std::string name, std::string new_value)
Updates the value of a String global.
Definition: globals.cpp:574
ImVec4
Definition: imgui.h:192
ImGui::End
IMGUI_API void End()
Definition: imgui.cpp:6016
BlamImGuiWindow
Class representing an ImGUI window.
Definition: imgui.h:31
ImVec2
Definition: imgui.h:179
Blam::Globals::GetGlobalAsColor
BLAM BlamColor * GetGlobalAsColor(std::string name)
Retrieves a global's value as a BlamColor.
Definition: globals.cpp:415
ImGui::Begin
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
Definition: imgui.cpp:5397
BlamImGuiWindow_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:23
ImGui::Text
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
Definition: imgui_widgets.cpp:238
ImGui::GetIO
IMGUI_API ImGuiIO & GetIO()
Definition: imgui.cpp:3300
ImGui::SetNextWindowSize
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiCond cond=0)
Definition: imgui.cpp:6741
BlamImGuiWindow_DirectX11Window::show_another_window
bool show_another_window
Toggles the built-in 'Another Window'.
Definition: dx11_window.hpp:17
ImGui::ShowDemoWindow
IMGUI_API void ShowDemoWindow(bool *p_open=NULL)
Definition: imgui_demo.cpp:195
ImGui::SliderFloat
IMGUI_API bool SliderFloat(const char *label, float *v, float v_min, float v_max, const char *format="%.3f", float power=1.0f)
Definition: imgui_widgets.cpp:2619
imgui.h
BlamImGuiWindow_DirectX11Window
Class for the default ImGUI DX11 sample window.
Definition: dx11_window.hpp:11
Blam::UI::ImGUI::GetVisibility
BLAM bool * GetVisibility(std::string key)
Retrieves the visibility of the specified draw list item.
Definition: debug_ui.cpp:206
ImGui::Button
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
Definition: imgui_widgets.cpp:644