Skip to content

Commit

Permalink
TestGearsES2GLJPanel*: Use GearsES1 is using bitmap - On Windows GDI …
Browse files Browse the repository at this point in the history
…would be returned!

We still have to solve the GL renderer selection / probing problem, i.e. in such cases
we don't know before context realization which GL renderer we actually receive.
  • Loading branch information
sgothel committed Jun 24, 2013
1 parent e5dd575 commit 3e528a6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Expand Up @@ -49,6 +49,7 @@
import com.jogamp.newt.event.TraceWindowAdapter;
import com.jogamp.newt.event.awt.AWTKeyAdapter;
import com.jogamp.newt.event.awt.AWTWindowAdapter;
import com.jogamp.opengl.test.junit.jogl.demos.es1.GearsES1;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
Expand Down Expand Up @@ -103,7 +104,11 @@ protected void runTestGL(GLCapabilities caps)
glJPanel.setMinimumSize(wsize);
glJPanel.setPreferredSize(wsize);
glJPanel.setSize(wsize);
glJPanel.addGLEventListener(new GearsES2(swapInterval));
if( caps.isBitmap() ) {
glJPanel.addGLEventListener(new GearsES1(swapInterval));
} else {
glJPanel.addGLEventListener(new GearsES2(swapInterval));
}
final SnapshotGLEventListener snap = new SnapshotGLEventListener();
glJPanel.addGLEventListener(snap);

Expand Down
Expand Up @@ -40,6 +40,7 @@
import javax.media.opengl.GLAnimatorControl;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLJPanel;
import javax.swing.JComponent;
Expand All @@ -54,6 +55,7 @@
import org.junit.Test;

import com.jogamp.common.nio.Buffers;
import com.jogamp.opengl.test.junit.jogl.demos.es1.GearsES1;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
Expand Down Expand Up @@ -118,10 +120,18 @@ private JComponent addPanel(GLCapabilitiesImmutable caps, GLAnimatorControl anim
if ( !useInterPanel ) {
canvas.setBounds(x, y, w, h);
}
GearsES2 demo = new GearsES2(swapInterval);
demo.setIgnoreFocus(true);
demo.setGearsColors(color, color, color);
demo.setClearColor(clearColor);
final GLEventListener demo;
if( caps.isBitmap() ) {
GearsES1 gdemo = new GearsES1(swapInterval);
gdemo.setGearsColors(color, color, color);
demo = gdemo;
} else {
GearsES2 gdemo = new GearsES2(swapInterval);
gdemo.setIgnoreFocus(true);
gdemo.setGearsColors(color, color, color);
gdemo.setClearColor(clearColor);
demo = gdemo;
}
canvas.addGLEventListener(demo);
if( null != anim ) {
anim.add(canvas);
Expand Down

0 comments on commit 3e528a6

Please sign in to comment.