mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-16 22:16:53 +07:00
add fullscreen toggling to samples
This commit is contained in:
@@ -172,6 +172,10 @@ namespace
|
|||||||
the<dbgui>().toggle_visible(!the<dbgui>().visible());
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -228,6 +228,10 @@ namespace
|
|||||||
the<dbgui>().toggle_visible(!the<dbgui>().visible());
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -198,6 +198,10 @@ namespace
|
|||||||
the<dbgui>().toggle_visible(!the<dbgui>().visible());
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,18 @@ namespace
|
|||||||
void process(ecs::registry& owner) override {
|
void process(ecs::registry& owner) override {
|
||||||
E2D_UNUSED(owner);
|
E2D_UNUSED(owner);
|
||||||
const keyboard& k = the<input>().keyboard();
|
const keyboard& k = the<input>().keyboard();
|
||||||
|
|
||||||
if ( k.is_key_just_released(keyboard_key::f12) ) {
|
if ( k.is_key_just_released(keyboard_key::f12) ) {
|
||||||
the<dbgui>().toggle_visible(!the<dbgui>().visible());
|
the<dbgui>().toggle_visible(!the<dbgui>().visible());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( k.is_key_just_released(keyboard_key::escape) ) {
|
if ( k.is_key_just_released(keyboard_key::escape) ) {
|
||||||
the<window>().set_should_close(true);
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user