mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-07 15:31:11 +00:00
sdlayer.cpp: Don't destroy window resouces if switching between software rendering on glsurface and Polymost/Polymer
git-svn-id: https://svn.eduke32.com/eduke32@6938 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a13a8bf579
commit
1b932fddaf
3 changed files with 18 additions and 3 deletions
|
@ -9941,7 +9941,6 @@ int32_t videoSetGameMode(char davidoption, int32_t daxdim, int32_t daydim, int32
|
||||||
|
|
||||||
if (videoGetRenderMode() >= REND_POLYMOST)
|
if (videoGetRenderMode() >= REND_POLYMOST)
|
||||||
{
|
{
|
||||||
//POGOTODO: if we switch to software & then back to GL, this call tries to delete textures that were already lost from the GL Context deletion
|
|
||||||
polymost_glreset();
|
polymost_glreset();
|
||||||
polymost_glinit();
|
polymost_glinit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,11 +171,15 @@ void glsurface_destroy()
|
||||||
glDeleteBuffers(1, &quadVertsID);
|
glDeleteBuffers(1, &quadVertsID);
|
||||||
quadVertsID = 0;
|
quadVertsID = 0;
|
||||||
|
|
||||||
|
glDisableVertexAttribArray(0);
|
||||||
|
glDisableVertexAttribArray(1);
|
||||||
|
|
||||||
glDeleteTextures(1, &bufferTexID);
|
glDeleteTextures(1, &bufferTexID);
|
||||||
bufferTexID = 0;
|
bufferTexID = 0;
|
||||||
glDeleteTextures(1, &paletteTexID);
|
glDeleteTextures(1, &paletteTexID);
|
||||||
paletteTexID = 0;
|
paletteTexID = 0;
|
||||||
|
|
||||||
|
glUseProgram(0);
|
||||||
glDeleteProgram(shaderProgramID);
|
glDeleteProgram(shaderProgramID);
|
||||||
shaderProgramID = 0;
|
shaderProgramID = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1453,8 +1453,13 @@ int32_t setvideomode_sdlcommon(int32_t *x, int32_t *y, int32_t c, int32_t fs, in
|
||||||
{
|
{
|
||||||
if (bpp > 8)
|
if (bpp > 8)
|
||||||
polymost_glreset();
|
polymost_glreset();
|
||||||
else if (!nogl)
|
}
|
||||||
|
if (!nogl)
|
||||||
|
{
|
||||||
|
if (bpp == 8)
|
||||||
glsurface_destroy();
|
glsurface_destroy();
|
||||||
|
if ((fs == fullscreen) && (*x == xres) && (*y == yres) && (bpp != 0) && !videomodereset)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1586,7 +1591,14 @@ int32_t videoSetMode(int32_t x, int32_t y, int32_t c, int32_t fs)
|
||||||
int32_t regrab = 0, ret;
|
int32_t regrab = 0, ret;
|
||||||
|
|
||||||
ret = setvideomode_sdlcommon(&x, &y, c, fs, ®rab);
|
ret = setvideomode_sdlcommon(&x, &y, c, fs, ®rab);
|
||||||
if (ret != 1) return ret;
|
if (ret != 1)
|
||||||
|
{
|
||||||
|
if (ret == 0)
|
||||||
|
{
|
||||||
|
setvideomode_sdlcommonpost(x, y, c, fs, regrab);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
// deinit
|
// deinit
|
||||||
destroy_window_resources();
|
destroy_window_resources();
|
||||||
|
|
Loading…
Reference in a new issue