Archived
1
Fork 0

Add keybind to toggle all imgui ui off

This commit is contained in:
Joshua Goins 2022-02-15 09:01:52 -05:00
parent 87a81111eb
commit 25ccd18595
2 changed files with 11 additions and 5 deletions

View file

@ -302,6 +302,7 @@ namespace prism {
#endif
bool console_enabled = true;
bool ui_enabled = true;
private:
void setup_scene(Scene& scene);

View file

@ -449,6 +449,9 @@ void engine::process_key_down(const unsigned int keyCode) {
if(keyCode == platform::get_keycode(InputButton::C))
console_enabled = !console_enabled;
if(keyCode == platform::get_keycode(InputButton::Backspace))
ui_enabled = !ui_enabled;
}
void engine::process_key_up(const unsigned int keyCode) {
@ -621,11 +624,13 @@ void engine::update_animation(const Animation& anim, const float time) {
void engine::begin_frame(const float delta_time) {
imgui->begin_frame(delta_time);
if(debug_enabled)
draw_debug_ui();
if(ui_enabled) {
if (debug_enabled)
draw_debug_ui();
if(console_enabled)
draw_console();
if (console_enabled)
draw_console();
}
if(current_app != nullptr)
current_app->begin_frame();