Show renderer name in window title

This commit is contained in:
Daniel Gibson 2017-02-19 03:12:05 +01:00
parent 7cd86106dc
commit 8723f73831
3 changed files with 20 additions and 8 deletions

View file

@ -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 */

View file

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

View file

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