made GL_Init() to be called every time a video mode is changed. we may

need to kill device and rendering contexts too, will see to that later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@781 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2012-11-06 08:50:45 +00:00
parent d15e823ab7
commit 7ce7ce71ca

View file

@ -307,6 +307,7 @@ static int VID_SetMode (int modenum)
vid.recalc_refdef = 1; vid.recalc_refdef = 1;
// with SDL, this needs to be done every time the render context is recreated, so I moved it here // with SDL, this needs to be done every time the render context is recreated, so I moved it here
GL_Init ();
TexMgr_ReloadImages (); TexMgr_ReloadImages ();
GL_SetupState (); GL_SetupState ();
@ -699,7 +700,6 @@ static void GL_CheckExtensions (void)
GL_SetupState -- johnfitz GL_SetupState -- johnfitz
does all the stuff from GL_Init that needs to be done every time a new GL render context is created does all the stuff from GL_Init that needs to be done every time a new GL render context is created
GL_Init will still do the stuff that only needs to be done once
=============== ===============
*/ */
static void GL_SetupState (void) static void GL_SetupState (void)
@ -737,8 +737,6 @@ static void GL_Init (void)
GL_CheckExtensions (); //johnfitz GL_CheckExtensions (); //johnfitz
Cmd_AddCommand ("gl_info", GL_Info_f); //johnfitz
if (SDL_strncasecmp(gl_renderer,"PowerVR",7)==0) if (SDL_strncasecmp(gl_renderer,"PowerVR",7)==0)
fullsbardraw = true; fullsbardraw = true;
if (SDL_strncasecmp(gl_renderer,"Permedia",8)==0) if (SDL_strncasecmp(gl_renderer,"Permedia",8)==0)
@ -759,9 +757,6 @@ static void GL_Init (void)
else else
Con_Printf ("%i bit stencil buffer\n", gl_stencilbits); Con_Printf ("%i bit stencil buffer\n", gl_stencilbits);
#endif #endif
GL_SetupState (); //johnfitz
// set vertical sync // set vertical sync
if (gl_swap_control) if (gl_swap_control)
{ {
@ -1307,6 +1302,8 @@ void VID_Init (void)
VID_SetMode (vid_default); VID_SetMode (vid_default);
GL_Init (); GL_Init ();
GL_SetupState ();
Cmd_AddCommand ("gl_info", GL_Info_f); //johnfitz
//johnfitz -- removed code creating "glquake" subdirectory //johnfitz -- removed code creating "glquake" subdirectory