From adb08a68f994aa24aa544bb2c42462911cc76604 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 7 Oct 2012 14:28:50 +0200 Subject: Simple JOGL2 port: Disable autoSwapBufferMode of GLCanvas (double swap == flicker); force display() when displayable (otherwise GL resources are not realized on windows) --- src/jake2/render/opengl/JoglDriver.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/jake2/render/opengl') diff --git a/src/jake2/render/opengl/JoglDriver.java b/src/jake2/render/opengl/JoglDriver.java index d4141ed..87cfd9f 100644 --- a/src/jake2/render/opengl/JoglDriver.java +++ b/src/jake2/render/opengl/JoglDriver.java @@ -278,7 +278,7 @@ public abstract class JoglDriver extends JoglGL implements GLDriver { } } canvas.requestFocus(); - + canvas.display(); // force GL resource validation this.display = canvas; setGL(display.getGL()); @@ -395,17 +395,20 @@ public abstract class JoglDriver extends JoglGL implements GLDriver { public Display(GLCapabilities capabilities) { super(capabilities); + setAutoSwapBufferMode(false); } + @Override public GL2 getGL() { activate(); return super.getGL().getGL2(); } - /** + /** * @see java.awt.Component#setBounds(int, int, int, int) */ + @Override public void setBounds(int x, int y, int width, int height) { final int mask = ~0x03; if ((width & 0x03) != 0) { @@ -422,7 +425,7 @@ public abstract class JoglDriver extends JoglGL implements GLDriver { void activate() { final GLContext ctx = this.getContext(); - if ( null != ctx && GLContext.getCurrent() != ctx ) { + if ( null != ctx && GLContext.getCurrent() != ctx ) { ctx.makeCurrent(); } } -- cgit v1.2.3