Skip to content

Commit

Permalink
Add keybinding for full screen toggle for daid/EmptyEpsilon#1750
Browse files Browse the repository at this point in the history
  • Loading branch information
daid committed Oct 28, 2022
1 parent 3ef5f26 commit 64cb3d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/windowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
#include "Renderable.h"
#include "collisionable.h"
#include "postProcessManager.h"
#include "io/keybinding.h"

#include <glm/gtc/type_ptr.hpp>
#include <cmath>
#include <SDL.h>
#include <stdlib.h>

sp::io::Keybinding fullscreen_key{"FULLSCREEN"};

static string getFromEnvironment(const char* key, string default_value) {
auto value = getenv(key);
if (!value)
Expand Down Expand Up @@ -61,6 +64,9 @@ Window::~Window()

void Window::render()
{
if (fullscreen_key.getDown())
setMode(getMode() == Mode::Window ? Mode::Fullscreen : Mode::Window);

SDL_GL_MakeCurrent(static_cast<SDL_Window*>(window), gl_context);

int w, h;
Expand Down

0 comments on commit 64cb3d0

Please sign in to comment.