From 34bcf9737502a6c16440f8a087fbd003ecf225d3 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Sun, 8 Dec 2019 09:24:38 +0100 Subject: [PATCH] params: add fixed_size property --- src/libsuperderpy.c | 4 +++- src/libsuperderpy.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libsuperderpy.c b/src/libsuperderpy.c index e32d1ea..7026b79 100644 --- a/src/libsuperderpy.c +++ b/src/libsuperderpy.c @@ -234,7 +234,9 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char* if (!game->config.fullscreen) { windowMode = ALLEGRO_WINDOWED; } - windowMode |= ALLEGRO_RESIZABLE; + if (!params.fixed_size) { + windowMode |= ALLEGRO_RESIZABLE; + } al_set_new_display_flags(windowMode | ALLEGRO_OPENGL | ALLEGRO_PROGRAMMABLE_PIPELINE); al_set_new_display_option(ALLEGRO_VSYNC, 2 - strtol(GetConfigOptionDefault(game, "SuperDerpy", "vsync", "1"), NULL, 10), ALLEGRO_SUGGEST); diff --git a/src/libsuperderpy.h b/src/libsuperderpy.h index ad4a9e2..f533f95 100644 --- a/src/libsuperderpy.h +++ b/src/libsuperderpy.h @@ -143,6 +143,7 @@ struct Params { int samplerate; /*!< Default sample rate of audio output; 0 to use engine default. */ char* window_title; /*!< A title of the game's window. When NULL, al_get_app_name() is used. */ struct Handlers handlers; /*!< A list of user callbacks to register. */ + bool fixed_size; /*!< If set to true, the game's window with not be resizable. */ }; /*! \brief Main struct of the game. */