diff --git a/src/backends/sdl/refresh.c b/src/backends/sdl/refresh.c index 59252a2a..5fe37703 100644 --- a/src/backends/sdl/refresh.c +++ b/src/backends/sdl/refresh.c @@ -231,7 +231,6 @@ GLimp_InitGraphics(qboolean fullscreen, int *pwidth, int *pheight) { int flags; int curWidth, curHeight; - char title[24]; int width = *pwidth; int height = *pheight; @@ -346,15 +345,10 @@ GLimp_InitGraphics(qboolean fullscreen, int *pwidth, int *pheight) cvar_t* gl_swapinterval = Cvar_Get("gl_swapinterval", "1", CVAR_ARCHIVE); vsync_active = gl_swapinterval->value ? true : false; - /* Window title */ - snprintf(title, sizeof(title), "Yamagi Quake II %s", YQ2VERSION); + /* Note: window title is now set in re.InitContext() to include renderer name */ #if SDL_VERSION_ATLEAST(2, 0, 0) - SDL_SetWindowTitle(window, title); - - /* Also set the window icon - For SDL2, this must be done after creating the window */ + /* Set the window icon - For SDL2, this must be done after creating the window */ SetSDLIcon(); -#else - SDL_WM_SetCaption(title, title); #endif /* No cursor */ diff --git a/src/client/refresh/gl/r_sdl.c b/src/client/refresh/gl/r_sdl.c index 79487913..89dbff15 100644 --- a/src/client/refresh/gl/r_sdl.c +++ b/src/client/refresh/gl/r_sdl.c @@ -373,6 +373,7 @@ int RI_PrepareForWindow(void) int RI_InitContext(void* win) { int msaa_samples = 0, stencil_bits = 0; + char title[40] = {0}; if(win == NULL) { @@ -417,6 +418,14 @@ int RI_InitContext(void* win) /* Initialize hardware gamma */ InitGamma(); + /* Window title - set here so we can display renderer name in it */ + snprintf(title, sizeof(title), "Yamagi Quake II %s - OpenGL 1.x", YQ2VERSION); +#if SDL_VERSION_ATLEAST(2, 0, 0) + SDL_SetWindowTitle(window, title); +#else + SDL_WM_SetCaption(title, title); +#endif + return true; } diff --git a/src/client/refresh/gl3/gl3_sdl.c b/src/client/refresh/gl3/gl3_sdl.c index 3bdd3cbf..82ed300c 100644 --- a/src/client/refresh/gl3/gl3_sdl.c +++ b/src/client/refresh/gl3/gl3_sdl.c @@ -172,6 +172,7 @@ DebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei le int GL3_InitContext(void* win) { int msaa_samples = 0, stencil_bits = 0; + char title[40] = {0}; if(win == NULL) { @@ -239,6 +240,14 @@ int GL3_InitContext(void* win) // glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW_ARB, 0, NULL, true); } + /* Window title - set here so we can display renderer name in it */ + snprintf(title, sizeof(title), "Yamagi Quake II %s - OpenGL 3.2", YQ2VERSION); +#if SDL_VERSION_ATLEAST(2, 0, 0) + SDL_SetWindowTitle(window, title); +#else + SDL_WM_SetCaption(title, title); +#endif + return true; }