Add keybind to toggle all imgui ui off
This commit is contained in:
parent
87a81111eb
commit
25ccd18595
2 changed files with 11 additions and 5 deletions
|
@ -302,6 +302,7 @@ namespace prism {
|
|||
#endif
|
||||
|
||||
bool console_enabled = true;
|
||||
bool ui_enabled = true;
|
||||
|
||||
private:
|
||||
void setup_scene(Scene& scene);
|
||||
|
|
|
@ -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) {
|
||||
|
@ -620,12 +623,14 @@ 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(console_enabled)
|
||||
draw_console();
|
||||
if(ui_enabled) {
|
||||
if (debug_enabled)
|
||||
draw_debug_ui();
|
||||
|
||||
if (console_enabled)
|
||||
draw_console();
|
||||
}
|
||||
|
||||
if(current_app != nullptr)
|
||||
current_app->begin_frame();
|
||||
|
|
Reference in a new issue