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

@ -63,6 +63,7 @@ import yugecin.opsudance.core.DisplayContainer;
import yugecin.opsudance.core.errorhandling.ErrorHandler;
import yugecin.opsudance.core.events.EventBus;
import yugecin.opsudance.events.BubbleNotificationEvent;
import yugecin.opsudance.events.ResolutionChangedEvent;
import yugecin.opsudance.movers.factories.ExgonMoverFactory;
import yugecin.opsudance.movers.factories.QuadraticBezierMoverFactory;
import yugecin.opsudance.movers.slidermovers.DefaultSliderMoverController;
@ -346,6 +347,7 @@ public class Options {
@Override
public void clickListItem(int index) {
resolutionIdx = index;
setDisplayMode(DisplayContainer.instance);
}
@Override

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);