aboutsummaryrefslogtreecommitdiffstats
path: root/src/demos/com/jogamp/opengl/demos/es2/PointsDemoES2.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/com/jogamp/opengl/demos/es2/PointsDemoES2.java')
-rw-r--r--src/demos/com/jogamp/opengl/demos/es2/PointsDemoES2.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/es2/PointsDemoES2.java b/src/demos/com/jogamp/opengl/demos/es2/PointsDemoES2.java
index 68152ad58..2dcebf91d 100644
--- a/src/demos/com/jogamp/opengl/demos/es2/PointsDemoES2.java
+++ b/src/demos/com/jogamp/opengl/demos/es2/PointsDemoES2.java
@@ -30,8 +30,14 @@ package com.jogamp.opengl.demos.es2;
import java.nio.FloatBuffer;
import com.jogamp.common.nio.Buffers;
+import com.jogamp.common.util.VersionUtil;
+import com.jogamp.newt.event.WindowAdapter;
+import com.jogamp.newt.event.WindowEvent;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.GLArrayDataServer;
import com.jogamp.opengl.util.PMVMatrix;
+import com.jogamp.opengl.util.caps.NonFSAAGLCapsChooser;
import com.jogamp.opengl.util.glsl.ShaderCode;
import com.jogamp.opengl.util.glsl.ShaderProgram;
import com.jogamp.opengl.util.glsl.ShaderState;
@@ -41,10 +47,13 @@ import com.jogamp.opengl.GL2ES1;
import com.jogamp.opengl.GL2ES2;
import com.jogamp.opengl.GL2GL3;
import com.jogamp.opengl.GLAutoDrawable;
+import com.jogamp.opengl.GLCapabilities;
+import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.GLUniformData;
import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.demos.PointsDemo;
+import com.jogamp.opengl.demos.graph.ui.util.GraphUIDemoArgs;
public class PointsDemoES2 extends PointsDemo {
ShaderState st;
@@ -211,4 +220,45 @@ public class PointsDemoES2 extends PointsDemo {
st = null;
pmvMatrix = null;
}
+
+ public static void main(final String[] args) {
+ final GraphUIDemoArgs options = new GraphUIDemoArgs(1280, 720, 0);
+
+ System.err.println(options);
+ System.err.println(VersionUtil.getPlatformInfo());
+ // System.err.println(JoglVersion.getAllAvailableCapabilitiesInfo(dpy.getGraphicsDevice(), null).toString());
+
+ final GLProfile glp = GLProfile.get(options.glProfileName);
+ System.err.println("GLProfile: "+glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
+ caps.setAlphaBits(4);
+ if( options.sceneMSAASamples > 0 ) {
+ caps.setSampleBuffers(true);
+ caps.setNumSamples(options.sceneMSAASamples);
+ }
+ System.out.println("Requested: " + caps);
+
+ final GLWindow window = GLWindow.create(caps);
+ if( 0 == options.sceneMSAASamples ) {
+ window.setCapabilitiesChooser(new NonFSAAGLCapsChooser(false));
+ }
+ window.setSize(options.surface_width, options.surface_height);
+ window.setTitle(PointsDemoES2.class.getSimpleName());
+
+ window.addGLEventListener(new PointsDemoES2(1));
+
+ final Animator animator = new Animator(0 /* w/o AWT */);
+ animator.setUpdateFPSFrames(5*60, null);
+ animator.add(window);
+
+ window.addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowDestroyed(final WindowEvent e) {
+ animator.stop();
+ }
+ });
+
+ window.setVisible(true);
+ animator.start();
+ }
}