params: add fixed_size property

This commit is contained in:
Sebastian Krzyszkowiak 2019-12-08 09:24:38 +01:00
parent 1d8fb9f2f3
commit 34bcf97375
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF
2 changed files with 4 additions and 1 deletions

View file

@ -234,7 +234,9 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char*
if (!game->config.fullscreen) {
windowMode = ALLEGRO_WINDOWED;
}
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);

View file

@ -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. */