add ability to enable multisampling via init params

This commit is contained in:
Sebastian Krzyszkowiak 2019-02-01 03:37:15 +01:00
parent e89f654559
commit 10164293ba
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF
2 changed files with 4 additions and 0 deletions

View file

@ -210,6 +210,9 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char*
al_set_new_display_option(ALLEGRO_DEPTH_SIZE, 24, ALLEGRO_SUGGEST); al_set_new_display_option(ALLEGRO_DEPTH_SIZE, 24, ALLEGRO_SUGGEST);
} }
al_set_new_display_option(ALLEGRO_SAMPLE_BUFFERS, params.samples ? 1 : 0, ALLEGRO_SUGGEST);
al_set_new_display_option(ALLEGRO_SAMPLES, params.samples, ALLEGRO_SUGGEST);
#ifdef ALLEGRO_WINDOWS #ifdef ALLEGRO_WINDOWS
al_set_new_window_position(20, 40); // workaround nasty Windows bug with window being created off-screen al_set_new_window_position(20, 40); // workaround nasty Windows bug with window being created off-screen
#endif #endif

View file

@ -127,6 +127,7 @@ struct Params {
bool integer_scaling; /*!< Ensure that the viewport is zoomed only with integer factors. */ bool integer_scaling; /*!< Ensure that the viewport is zoomed only with integer factors. */
bool depth_buffer; /*!< Request a depth buffer for the framebuffer's render target. */ bool depth_buffer; /*!< Request a depth buffer for the framebuffer's render target. */
bool show_loading_on_launch; /*!< Whether the loading screen should be shown when loading the initial set of gamestates. */ bool show_loading_on_launch; /*!< Whether the loading screen should be shown when loading the initial set of gamestates. */
int samples; /*!< How many samples should be used for multisampling; 0 to disable. */
char* window_title; /*!< A title of the game's window. When NULL, al_get_app_name() is used. */ 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. */ struct Handlers handlers; /*!< A list of user callbacks to register. */
}; };