From 383983ef9df0e7b8b9a5cfc4fb54b1a79e2e72e6 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Thu, 11 Jun 2020 03:54:30 +0300 Subject: [PATCH] form window title in pc_main; show correct RAPI in it --- src/pc/gfx/gfx_pc.c | 13 +------------ src/pc/gfx/gfx_pc.h | 2 +- src/pc/pc_main.c | 16 +++++++++++++++- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/pc/gfx/gfx_pc.c b/src/pc/gfx/gfx_pc.c index 20430019..9fa7dbfd 100644 --- a/src/pc/gfx/gfx_pc.c +++ b/src/pc/gfx/gfx_pc.c @@ -1718,18 +1718,7 @@ void gfx_get_dimensions(uint32_t *width, uint32_t *height) { gfx_wapi->get_dimensions(width, height); } -void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi) { - char window_title[96] = - #ifndef USE_GLES - "Super Mario 64 PC port (OpenGL)" - #else - "Super Mario 64 PC port (OpenGL_ES2)" - #endif - #ifdef NIGHTLY - " nightly " GIT_HASH - #endif - ; - +void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *window_title) { gfx_wapi = wapi; gfx_rapi = rapi; gfx_wapi->init(window_title); diff --git a/src/pc/gfx/gfx_pc.h b/src/pc/gfx/gfx_pc.h index 53a1677b..0d1780b3 100644 --- a/src/pc/gfx/gfx_pc.h +++ b/src/pc/gfx/gfx_pc.h @@ -11,7 +11,7 @@ struct GfxDimensions { extern struct GfxDimensions gfx_current_dimensions; -void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi); +void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *window_title); void gfx_start_frame(void); void gfx_run(Gfx *commands); void gfx_end_frame(void); diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c index c3e156d8..2020464c 100644 --- a/src/pc/pc_main.c +++ b/src/pc/pc_main.c @@ -175,15 +175,29 @@ void main_func(void) { #if defined(RAPI_D3D11) rendering_api = &gfx_d3d11_api; + # define RAPI_NAME "DirectX 11" #elif defined(RAPI_D3D12) rendering_api = &gfx_d3d12_api; + # define RAPI_NAME "DirectX 12" #elif defined(RAPI_GL) || defined(RAPI_GL_LEGACY) rendering_api = &gfx_opengl_api; + # ifdef USE_GLES + # define RAPI_NAME "OpenGL ES" + # else + # define RAPI_NAME "OpenGL" + # endif #else #error No rendering API! #endif - gfx_init(wm_api, rendering_api); + char window_title[96] = + "Super Mario 64 PC port (" RAPI_NAME ")" + #ifdef NIGHTLY + " nightly " GIT_HASH + #endif + ; + + gfx_init(wm_api, rendering_api, window_title); wm_api->set_keyboard_callbacks(keyboard_on_key_down, keyboard_on_key_up, keyboard_on_all_keys_up); if (audio_api == NULL && audio_sdl.init())