aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-07 14:28:50 +0200
committerSven Gothel <[email protected]>2012-10-07 14:28:50 +0200
commitadb08a68f994aa24aa544bb2c42462911cc76604 (patch)
tree14788ee02846340453f4c68a58bd91822dc4e81c /src/jake2
parentac178d797e6ad97d2ec47f4c6dc2c8b51170efec (diff)
Simple JOGL2 port: Disable autoSwapBufferMode of GLCanvas (double swap == flicker); force display() when displayable (otherwise GL resources are not realized on windows)
Diffstat (limited to 'src/jake2')
-rw-r--r--src/jake2/render/opengl/JoglDriver.java9
1 files changed, 6 insertions, 3 deletions
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();
}
}