libsuperderpy: Allow to set custom background color via params

This commit is contained in:
Sebastian Krzyszkowiak 2022-07-21 05:11:42 +02:00
parent 73d9dde2a6
commit a710541e4e
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF
2 changed files with 4 additions and 0 deletions

View file

@ -120,6 +120,9 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char*
game->_priv.window_width = 0;
game->_priv.window_height = 0;
game->_priv.bg = params.bg_color;
game->_priv.bg.a = 1.0;
game->_priv.mutex = al_create_mutex();
game->config.fullscreen = strtol(GetConfigOptionDefault(game, "SuperDerpy", "fullscreen", IS_POCKETCHIP ? "0" : "1"), NULL, 10);

View file

@ -152,6 +152,7 @@ struct Params {
int samples; /*!< How many samples should be used for multisampling; 0 to disable. */
int sample_rate; /*!< 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. */
ALLEGRO_COLOR bg_color; /*!< Default background color of the game window. Only opaque colors are supported. */
struct Handlers handlers; /*!< A list of user callbacks to register. */
};