From 10164293baf79faad9202a45d95df9360148445e Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Fri, 1 Feb 2019 03:37:15 +0100 Subject: [PATCH] add ability to enable multisampling via init params --- src/libsuperderpy.c | 3 +++ src/libsuperderpy.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/libsuperderpy.c b/src/libsuperderpy.c index e05d490..b22d40d 100644 --- a/src/libsuperderpy.c +++ b/src/libsuperderpy.c @@ -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_SAMPLE_BUFFERS, params.samples ? 1 : 0, ALLEGRO_SUGGEST); + al_set_new_display_option(ALLEGRO_SAMPLES, params.samples, ALLEGRO_SUGGEST); + #ifdef ALLEGRO_WINDOWS al_set_new_window_position(20, 40); // workaround nasty Windows bug with window being created off-screen #endif diff --git a/src/libsuperderpy.h b/src/libsuperderpy.h index fa11c81..23412c2 100644 --- a/src/libsuperderpy.h +++ b/src/libsuperderpy.h @@ -127,6 +127,7 @@ struct Params { 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 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. */ struct Handlers handlers; /*!< A list of user callbacks to register. */ };