Skip to content

Commit

Permalink
Fixed incorrect management of GL textures used with the sky sphere
Browse files Browse the repository at this point in the history
When resetting GL, any acquired textures should either be deleted prior
to setting up a new render context and clear the variables used to track
their identifiers on application side at this time, or, simply "forget"
about the uploaded content and clear the identifier tracking values.
  • Loading branch information
danij-deng committed Oct 29, 2011
1 parent 4f1e2d6 commit cf84bbc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/r_sky.h
Expand Up @@ -113,7 +113,7 @@ void R_SetupSky(ded_sky_t* sky);
/**
* Mark all skies as requiring a full update. Called during engine/renderer reset.
*/
void R_SkyUpdate(void);
void R_ReleaseGLTexturesForSkies(void);

void R_SetupSkyModels(ded_sky_t* sky);
void R_SetupSkySphereParamsForSkyLayer(rendskysphereparams_t* params, int layer);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/gl_texmanager.c
Expand Up @@ -1660,6 +1660,7 @@ void GL_ReleaseRuntimeTextures(void)
GL_ReleaseTexturesForRawImages();

R_ReleaseGLTexturesForSkins();
R_ReleaseGLTexturesForSkies();
Rend_ParticleReleaseExtraTextures();
Fonts_ReleaseRuntimeGLTextures();
}
Expand Down Expand Up @@ -3256,7 +3257,6 @@ static int doTexReset(void* parm)
/// \todo re-upload ALL textures currently in use.
GL_LoadSystemTextures();
Rend_ParticleLoadExtraTextures();
R_SkyUpdate();

GL_PruneTextureVariantSpecifications();

Expand Down
1 change: 0 additions & 1 deletion doomsday/engine/portable/src/r_main.c
Expand Up @@ -477,7 +477,6 @@ void R_Update(void)

Def_PostInit();
P_UpdateParticleGens(); // Defs might've changed.
R_SkyUpdate();

// Reset the archived map cache (the available maps may have changed).
DAM_Init();
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/r_sky.c
Expand Up @@ -388,7 +388,7 @@ void R_SkyTicker(void)
}
}

void R_SkyUpdate(void)
void R_ReleaseGLTexturesForSkies(void)
{
if(novideo || isDedicated)
return;
Expand Down

0 comments on commit cf84bbc

Please sign in to comment.