add fullscreen toggling to samples

This commit is contained in:
2019-03-17 08:53:46 +07:00
parent 7f17d235ca
commit 4094a536a9
4 changed files with 18 additions and 0 deletions

View File

@@ -172,6 +172,10 @@ namespace
the<dbgui>().toggle_visible(!the<dbgui>().visible());
}
if ( k.is_key_pressed(keyboard_key::lsuper) && k.is_key_just_released(keyboard_key::enter) ) {
the<window>().toggle_fullscreen(!the<window>().fullscreen());
}
return true;
}

View File

@@ -228,6 +228,10 @@ namespace
the<dbgui>().toggle_visible(!the<dbgui>().visible());
}
if ( k.is_key_pressed(keyboard_key::lsuper) && k.is_key_just_released(keyboard_key::enter) ) {
the<window>().toggle_fullscreen(!the<window>().fullscreen());
}
return true;
}

View File

@@ -198,6 +198,10 @@ namespace
the<dbgui>().toggle_visible(!the<dbgui>().visible());
}
if ( k.is_key_pressed(keyboard_key::lsuper) && k.is_key_just_released(keyboard_key::enter) ) {
the<window>().toggle_fullscreen(!the<window>().fullscreen());
}
return true;
}

View File

@@ -18,12 +18,18 @@ namespace
void process(ecs::registry& owner) override {
E2D_UNUSED(owner);
const keyboard& k = the<input>().keyboard();
if ( k.is_key_just_released(keyboard_key::f12) ) {
the<dbgui>().toggle_visible(!the<dbgui>().visible());
}
if ( k.is_key_just_released(keyboard_key::escape) ) {
the<window>().set_should_close(true);
}
if ( k.is_key_pressed(keyboard_key::lsuper) && k.is_key_just_released(keyboard_key::enter) ) {
the<window>().toggle_fullscreen(!the<window>().fullscreen());
}
}
};