diff --git a/src/pc/gfx/gfx_opengl.c b/src/pc/gfx/gfx_opengl.c index 7bc9745..db15b6f 100644 --- a/src/pc/gfx/gfx_opengl.c +++ b/src/pc/gfx/gfx_opengl.c @@ -503,6 +503,10 @@ static void gfx_opengl_end_frame(void) { static void gfx_opengl_finish_render(void) { } +const char* gfx_opengl_get_name(void) { + return "OpenGL"; +} + struct GfxRenderingAPI gfx_opengl_api = { gfx_opengl_z_is_from_0_to_1, gfx_opengl_unload_shader, @@ -525,7 +529,8 @@ struct GfxRenderingAPI gfx_opengl_api = { gfx_opengl_on_resize, gfx_opengl_start_frame, gfx_opengl_end_frame, - gfx_opengl_finish_render + gfx_opengl_finish_render, + gfx_opengl_get_name, }; #endif diff --git a/src/pc/gfx/gfx_pc.c b/src/pc/gfx/gfx_pc.c index 15d7b94..522e8bf 100644 --- a/src/pc/gfx/gfx_pc.c +++ b/src/pc/gfx/gfx_pc.c @@ -1611,7 +1611,7 @@ void gfx_get_dimensions(uint32_t *width, uint32_t *height) { void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *game_name, bool start_in_fullscreen) { gfx_wapi = wapi; gfx_rapi = rapi; - gfx_wapi->init(game_name, start_in_fullscreen); + gfx_wapi->init(game_name, rapi->get_name(), start_in_fullscreen); gfx_rapi->init(); // Used in the 120 star TAS diff --git a/src/pc/gfx/gfx_rendering_api.h b/src/pc/gfx/gfx_rendering_api.h index ed6f1c4..88e2607 100644 --- a/src/pc/gfx/gfx_rendering_api.h +++ b/src/pc/gfx/gfx_rendering_api.h @@ -30,6 +30,7 @@ struct GfxRenderingAPI { void (*start_frame)(void); void (*end_frame)(void); void (*finish_render)(void); + const char* (*get_name)(void); }; #endif diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c index 923d264..fed80fb 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -22,8 +22,6 @@ #include "gfx_window_manager_api.h" #include "gfx_screen_config.h" -#define GFX_API_NAME "SDL2 - OpenGL" - static SDL_Window *wnd; static int inverted_scancode_table[512]; static int vsync_enabled = 0; @@ -152,7 +150,7 @@ int test_vsync(void) { } } -static void gfx_sdl_init(const char *game_name, bool start_in_fullscreen) { +static void gfx_sdl_init(const char *game_name, const char* gfx_name, bool start_in_fullscreen) { SDL_Init(SDL_INIT_VIDEO); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); @@ -162,7 +160,7 @@ static void gfx_sdl_init(const char *game_name, bool start_in_fullscreen) { //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); char title[512]; - int len = sprintf(title, "%s (%s)", game_name, GFX_API_NAME); + int len = sprintf(title, "%s (SDL - %s)", game_name, gfx_name); wnd = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, window_width, window_height, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE); diff --git a/src/pc/gfx/gfx_window_manager_api.h b/src/pc/gfx/gfx_window_manager_api.h index 6ba4a2d..0dad9a2 100644 --- a/src/pc/gfx/gfx_window_manager_api.h +++ b/src/pc/gfx/gfx_window_manager_api.h @@ -5,7 +5,7 @@ #include struct GfxWindowManagerAPI { - void (*init)(const char *game_name, bool start_in_fullscreen); + void (*init)(const char *game_name, const char* gfx_name, bool start_in_fullscreen); void (*set_keyboard_callbacks)(bool (*on_key_down)(int scancode), bool (*on_key_up)(int scancode), void (*on_all_keys_up)(void)); void (*set_fullscreen_changed_callback)(void (*on_fullscreen_changed)(bool is_now_fullscreen)); void (*set_fullscreen)(bool enable);