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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user