Skip to content

Commit 64cb3d0

Browse files
committed
Add keybinding for full screen toggle for daid/EmptyEpsilon#1750
1 parent 3ef5f26 commit 64cb3d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/windowManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
#include "Renderable.h"
1313
#include "collisionable.h"
1414
#include "postProcessManager.h"
15+
#include "io/keybinding.h"
1516

1617
#include <glm/gtc/type_ptr.hpp>
1718
#include <cmath>
1819
#include <SDL.h>
1920
#include <stdlib.h>
2021

22+
sp::io::Keybinding fullscreen_key{"FULLSCREEN"};
23+
2124
static string getFromEnvironment(const char* key, string default_value) {
2225
auto value = getenv(key);
2326
if (!value)
@@ -61,6 +64,9 @@ Window::~Window()
6164

6265
void Window::render()
6366
{
67+
if (fullscreen_key.getDown())
68+
setMode(getMode() == Mode::Window ? Mode::Fullscreen : Mode::Window);
69+
6470
SDL_GL_MakeCurrent(static_cast<SDL_Window*>(window), gl_context);
6571

6672
int w, h;

0 commit comments

Comments
 (0)