Correctly clean up the created OpenGL objects created for the slider rendering.

This is necessary because the OpenGL context being closed does apparently not close
the process and the game can be restarted with another resolution without shutting
down the process completely.
This commit is contained in:
Peter Tissen
2015-06-24 23:55:05 +02:00
parent 392df79596
commit 1993452669
4 changed files with 62 additions and 4 deletions

View File

@@ -122,6 +122,20 @@ public class FrameBufferCache {
return buffer;
}
public static void shutdown()
{
//if there were any previous Framebuffers in the cache delete them
//this is necessary for cases when the game gets re-started with a
//different resolution without closing the process
FrameBufferCache fbcInstance = FrameBufferCache.getInstance();
for(Rendertarget target: fbcInstance.cache)
{
target.destroyRTT();
}
fbcInstance.cache.clear();
fbcInstance.freeMap();
}
/**
* There should only ever be one framebuffer cache, this function returns
* that one framebuffer cache instance.