Minor - Ajoute un mode debug activable - V
Implements a debug mode toggleable via key press. Adds a global debug flag to enable/disable debug features. Updates the frame logic to toggle debug mode on key press. Adjusts ImGui rendering to be conditional on debug mode.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[Window][DockSpace]
|
||||
Pos=0,0
|
||||
Size=1536,793
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Debug##Default]
|
||||
@@ -57,7 +57,7 @@ Collapsed=0
|
||||
DockId=0x00000002,0
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1536,774 Split=X
|
||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,842 Split=X
|
||||
DockNode ID=0x00000001 Parent=0xCCBD8CF7 SizeRef=1350,842 Split=X
|
||||
DockNode ID=0x00000005 Parent=0x00000001 SizeRef=1265,842 Split=Y
|
||||
DockNode ID=0x00000003 Parent=0x00000005 SizeRef=1584,609 Split=X
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
#include "../resources.h"
|
||||
#include <chrono>
|
||||
|
||||
// global variables
|
||||
inline bool DEBUG_MODE = false;
|
||||
|
||||
class system_class
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -176,17 +176,27 @@ bool system_class::frame()
|
||||
R_FALSE
|
||||
}
|
||||
|
||||
if(!input_->IsKeyDown(222))
|
||||
{
|
||||
//log the key press
|
||||
is_debug_key_pressed_ = false;
|
||||
}
|
||||
else if (input_->IsKeyDown(222) && !is_debug_key_pressed_)
|
||||
{
|
||||
// Log the key release state
|
||||
is_debug_key_pressed_ = true;
|
||||
DEBUG_MODE = !DEBUG_MODE;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (input_->IsKeyDown(DIK_F1))
|
||||
|
||||
if (DEBUG_MODE && !imgui_manager_->ImGuiWidgetRenderer())
|
||||
{
|
||||
// render ImGui
|
||||
result = imgui_manager_->ImGuiWidgetRenderer();
|
||||
if (!result)
|
||||
{
|
||||
LOG_ERROR("Failed to render ImGui widgets");
|
||||
R_FALSE
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
application_->get_direct_3d()->end_scene();
|
||||
|
||||
BIN
x64/Debug/config.txt
(Stored with Git LFS)
BIN
x64/Debug/config.txt
(Stored with Git LFS)
Binary file not shown.
BIN
x64/Release/config.txt
(Stored with Git LFS)
BIN
x64/Release/config.txt
(Stored with Git LFS)
Binary file not shown.
Reference in New Issue
Block a user