Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
crash_test.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
6 
13 {
14 public:
18  void Draw()
19  {
20  //Crash test
21  if (!show)
22  {
23  return;
24  }
25 
26  ImGui::OpenPopup(" SOMEBODY PULL A NUKE");
27 
28  if (ImGui::BeginPopupModal(" SOMEBODY PULL A NUKE", NULL, ImGuiWindowFlags_AlwaysAutoResize))
29  {
30  ImGui::Text("Are you sure you want to crash the engine?\n\n");
32 
33  if (ImGui::Button("Yes", ImVec2(120, 0)))
34  {
36  BLAM_ASSERTM(0, "User manually invoked the crash.");
37  /*raise(SIGSEGV);*/
38  }
39 
41 
42  if (ImGui::Button("No", ImVec2(120, 0)))
43  {
45  show = false;
46  }
47 
49  }
50  }
51 };
ImGui::EndPopup
IMGUI_API void EndPopup()
Definition: imgui.cpp:7675
BlamImGuiWindow::show
bool show
Controls whether or not the group should be shown. May not be used in all groups.
Definition: imgui.h:34
ImGui::BeginPopupModal
IMGUI_API bool BeginPopupModal(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
Definition: imgui.cpp:7647
ImGui::SameLine
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f)
Definition: imgui.cpp:7147
BlamImGuiWindow
Class representing an ImGUI window.
Definition: imgui.h:31
ImVec2
Definition: imgui.h:179
NULL
Add a fourth parameter to bake specific font ranges NULL
Definition: README.txt:57
ImGui::OpenPopup
IMGUI_API void OpenPopup(const char *str_id)
Definition: imgui.cpp:7453
ImGui::Text
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
Definition: imgui_widgets.cpp:238
BlamImGuiWindow_CrashTest
Class for the crash test dialog.
Definition: crash_test.hpp:12
BLAM_ASSERTM
#define BLAM_ASSERTM(x, msg)
Invokes an engine assertion, with an optional message.
Definition: crash.h:26
crash.h
ImGuiWindowFlags_AlwaysAutoResize
@ ImGuiWindowFlags_AlwaysAutoResize
Definition: imgui.h:720
ImGui::CloseCurrentPopup
IMGUI_API void CloseCurrentPopup()
Definition: imgui.cpp:7581
imgui.h
BlamImGuiWindow_CrashTest::Draw
void Draw()
Prompts the user for a confirmation, and invokes an assertion failure if confirmed.
Definition: crash_test.hpp:18
ImGui::Separator
IMGUI_API void Separator()
Definition: imgui_widgets.cpp:1284
ImGui::Button
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
Definition: imgui_widgets.cpp:644