form window title in pc_main; show correct RAPI in it

This commit is contained in:
fgsfds 2020-06-11 03:54:30 +03:00
parent a81a8e6ef1
commit 383983ef9d
3 changed files with 17 additions and 14 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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())