on the fly resolution changing

This commit is contained in:
yugecin
2017-01-21 14:23:34 +01:00
parent d311f8bb95
commit 83df73fc04
2 changed files with 11 additions and 0 deletions

View File

@@ -59,6 +59,9 @@ import static yugecin.opsudance.core.Entrypoint.sout;
*/
public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListener {
@Deprecated
public static DisplayContainer instance; // TODO d remove this
private static SGL GL = Renderer.get();
public final EventBus eventBus;
@@ -117,6 +120,7 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
this.eventBus = eventBus;
this.cursor = new Cursor();
drawCursor = true;
instance = this;
outTransitionListener = new TransitionFinishedListener() {
@Override
@@ -317,6 +321,11 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
}
private void initGL() throws Exception {
InternalTextureLoader.get().clear();
GameImage.destroyImages();
GameData.Grade.destroyImages();
Beatmap.destroyBackgroundImageCache();
GL.initDisplay(width, height);
GL.enterOrtho(width, height);