Elaztek Developer Hub
Blamite Game Engine - blam!  00346.12.11.21.0529.blamite
The core library for the Blamite Game Engine.
crash_test.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../../debug_ui.h"
4 
6 
8 {
15  {
16  public:
20  CrashTest() {}
21 
26 
30  void Draw()
31  {
32  //Crash test
33  if (show)
34  {
35  ImGui::OpenPopup(" SOMEBODY PULL A NUKE");
36  if (ImGui::BeginPopupModal(" SOMEBODY PULL A NUKE", NULL, ImGuiWindowFlags_AlwaysAutoResize))
37  {
38  ImGui::Text("Are you sure you want to crash the engine?\n\n");
40 
41  if (ImGui::Button("Yes", ImVec2(120, 0))) { BLAM_ASSERTM(0, "User manually invoked the crash."); /*raise(SIGSEGV);*/ }
43  if (ImGui::Button("No", ImVec2(120, 0))) { ImGui::CloseCurrentPopup(); show = false; }
45  }
46  }
47  }
48  };
49 }
ImGui::EndPopup
IMGUI_API void EndPopup()
Definition: imgui.cpp:7675
Blam::DebugUI::Windows::CrashTest::~CrashTest
~CrashTest()
Empty destructor.
Definition: crash_test.hpp:25
ImGui::BeginPopupModal
IMGUI_API bool BeginPopupModal(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
Definition: imgui.cpp:7647
Blam::DebugUI::Windows::CrashTest
Class for the crash test dialog.
Definition: crash_test.hpp:14
ImGui::SameLine
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f)
Definition: imgui.cpp:7147
ImVec2
Definition: imgui.h:179
ImGui::OpenPopup
IMGUI_API void OpenPopup(const char *str_id)
Definition: imgui.cpp:7453
NULL
Add a fourth parameter to bake specific font ranges NULL
Definition: README.txt:57
Blam::DebugUI::Windows::CrashTest::CrashTest
CrashTest()
Empty constructor.
Definition: crash_test.hpp:20
ImGui::Text
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
Definition: imgui_widgets.cpp:238
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:362
Blam::DebugUI::ImGUIDrawingGroup
Class representing an ImGUI drawing group/draw list item.
Definition: debug_ui.h:359
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::Separator
IMGUI_API void Separator()
Definition: imgui_widgets.cpp:1284
Blam::DebugUI::Windows
Legacy namespace to contain data for the legacy ImGUI console.
Definition: ui.h:14
Blam::DebugUI::Windows::CrashTest::Draw
void Draw()
Prompts the user for a confirmation, and invokes an assertion failure if confirmed.
Definition: crash_test.hpp:30
ImGui::Button
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
Definition: imgui_widgets.cpp:644