examples/display/DisplayExample.cpp: make "W" key switch to windowed fullscreen.
This commit is contained in:
parent
4761473e86
commit
1c27fce58c
1 changed files with 13 additions and 1 deletions
|
|
@ -24,7 +24,19 @@ void DisplayExample::onEvent(const sp::Event& event)
|
||||||
{
|
{
|
||||||
if (event.type == sp::Event::Key && event.key.pressed == false) {
|
if (event.type == sp::Event::Key && event.key.pressed == false) {
|
||||||
|
|
||||||
if (event.key.code == sp::Keyboard::Space) {
|
if (event.key.code == sp::Keyboard::W) {
|
||||||
|
|
||||||
|
if (m_mode == sp::Display::WINDOWED) {
|
||||||
|
m_mode = sp::Display::WINDOWEDFULLSCREEN;
|
||||||
|
sp::Log::info("Windowed Fullscreen");
|
||||||
|
} else {
|
||||||
|
m_mode = sp::Display::WINDOWED;
|
||||||
|
sp::Log::info("Windowed");
|
||||||
|
}
|
||||||
|
|
||||||
|
getGraphics()->setDisplayMode(m_mode);
|
||||||
|
|
||||||
|
} else if (event.key.code == sp::Keyboard::Space) {
|
||||||
|
|
||||||
if (m_mode == sp::Display::WINDOWED) {
|
if (m_mode == sp::Display::WINDOWED) {
|
||||||
m_mode = sp::Display::FULLSCREEN;
|
m_mode = sp::Display::FULLSCREEN;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue