JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
Launcher0.java
Go to the documentation of this file.
1/**
2 * Copyright 2019 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28
29package com.jogamp.opengl.demos;
30
31import java.io.IOException;
32import java.lang.reflect.Constructor;
33
34import com.jogamp.newt.Display;
35import com.jogamp.newt.Display.PointerIcon;
36import com.jogamp.newt.NewtFactory;
37import com.jogamp.newt.Screen;
38import com.jogamp.newt.event.WindowEvent;
39import com.jogamp.newt.event.TraceMouseAdapter;
40import com.jogamp.newt.event.WindowAdapter;
41import com.jogamp.newt.opengl.GLWindow;
42import com.jogamp.newt.opengl.util.NEWTDemoListener;
43import com.jogamp.opengl.util.Animator;
44import com.jogamp.opengl.util.AnimatorBase;
45import com.jogamp.common.util.ReflectionUtil;
46import com.jogamp.nativewindow.ScalableSurface;
47import com.jogamp.nativewindow.util.Dimension;
48import com.jogamp.nativewindow.util.Point;
49import com.jogamp.nativewindow.util.PointImmutable;
50import com.jogamp.nativewindow.util.DimensionImmutable;
51import com.jogamp.opengl.GL;
52import com.jogamp.opengl.GLAnimatorControl;
53import com.jogamp.opengl.GLAutoDrawable;
54import com.jogamp.opengl.GLCapabilities;
55import com.jogamp.opengl.GLEventListener;
56import com.jogamp.opengl.GLPipelineFactory;
57import com.jogamp.opengl.GLProfile;
58import com.jogamp.opengl.demos.es2.RedSquareES2;
59import com.jogamp.opengl.demos.util.MiscUtils;
60
61/**
62 * <p>
63 * The demo code uses {@link NEWTDemoListener} functionality.
64 * </p>
65 * <p>
66 * Manual invocation via main allows setting each tests's duration in milliseconds, e.g.{@code -duration 10000} and many more, see {@link #main(String[])}
67 * </p>
68 */
69public class Launcher0 {
70 static int screenIdx = 0;
71 static PointImmutable wpos;
72 static DimensionImmutable wsize = new Dimension(640, 480), rwsize=null;
73 static float[] reqSurfacePixelScale = new float[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
74
75 static String demoName = "com.jogamp.opengl.demos.es2.GearsES2";
76 static long duration = 500; // ms
77 static boolean opaque = true;
78 static int forceAlpha = -1;
79 static boolean undecorated = false;
80 static boolean alwaysOnTop = false;
81 static boolean alwaysOnBottom = false;
82 static boolean resizable = true;
83 static boolean sticky = false;
84 static boolean max_vert= false;
85 static boolean max_horz= false;
86 static boolean fullscreen = false;
87 static int swapInterval = 1;
88 static boolean waitForKey = false;
89 static boolean mouseVisible = true;
90 static boolean mouseConfined = false;
91 static boolean useMultiplePointerIcon = true;
92 static boolean showFPS = true;
93 static boolean forceES2 = false;
94 static boolean forceES3 = false;
95 static boolean forceGL3 = false;
96 static boolean forceGL2 = false;
97 static boolean useDoubleBuffer = true;
98 static boolean forceDebug = false;
99 static boolean forceTrace = false;
100 static boolean traceMouse = false;
101 static boolean exclusiveContext = false;
102 static boolean useAnimator = true;
103
104 public void runTest() throws InterruptedException {
105 final GLProfile glp;
106 if(forceGL3) {
107 glp = GLProfile.get(GLProfile.GL3);
108 } else if(forceES3) {
110 } else if(forceES2) {
112 } else if(forceGL2) {
113 glp = GLProfile.get(GLProfile.GL2);
114 } else {
115 glp = GLProfile.getGL2ES2();
116 }
117 final GLCapabilities caps = new GLCapabilities( glp );
118 caps.setBackgroundOpaque(opaque);
119 if(-1 < forceAlpha) {
120 caps.setAlphaBits(forceAlpha);
121 }
122 caps.setDoubleBuffered(useDoubleBuffer);
123
124 System.err.println("requested: vsync "+swapInterval+", "+caps);
125 final Display dpy = NewtFactory.createDisplay(null);
126 final Screen screen = NewtFactory.createScreen(dpy, screenIdx);
127 final GLWindow glWindow = GLWindow.create(screen, caps);
128
129 glWindow.setSurfaceScale(reqSurfacePixelScale);
130 final float[] valReqSurfacePixelScale = glWindow.getRequestedSurfaceScale(new float[2]);
131 glWindow.setSize(wsize.getWidth(), wsize.getHeight());
132 if(null != wpos) {
133 glWindow.setPosition(wpos.getX(), wpos.getY());
134 }
135 glWindow.setUndecorated(undecorated);
136 glWindow.setAlwaysOnTop(alwaysOnTop);
137 glWindow.setAlwaysOnBottom(alwaysOnBottom);
138 glWindow.setResizable(resizable);
139 glWindow.setSticky(sticky);
140 glWindow.setMaximized(max_horz, max_vert);
141 glWindow.setFullscreen(fullscreen);
142 glWindow.setPointerVisible(mouseVisible);
143 glWindow.confinePointer(mouseConfined);
144
145 final GLEventListener demo;
146 {
147 GLEventListener _demo = null;
148 try {
149 final Class<?> demoClazz = ReflectionUtil.getClass(demoName, true, Launcher0.class.getClassLoader());
150 try {
151 // with swapInterval
152 System.err.println("Loading "+demoName+"("+swapInterval+")");
153 final Constructor<?> ctr = ReflectionUtil.getConstructor(demoClazz, int.class);
154 _demo = (GLEventListener) ReflectionUtil.createInstance(ctr, swapInterval);
155 } catch( final Exception e ) {
156 System.err.println(e.getMessage()+" using.0: <"+demoName+">");
157 }
158 if( null == _demo ) {
159 // without swapInterval
160 System.err.println("Loading "+demoName+"()");
161 _demo = (GLEventListener) ReflectionUtil.createInstance(demoClazz);
162 }
163 } catch( final Exception e ) {
164 System.err.println(e.getMessage()+" using.1: <"+demoName+">");
165 }
166 if( null == _demo ) {
167 System.err.println("Loading RedSquareES2()");
168 _demo = new RedSquareES2();
169 }
170 demo = _demo;
171 }
172 System.out.println("Choosen demo "+demo.getClass().getName());
173 if( forceDebug || forceTrace ) {
174 glWindow.addGLEventListener(new GLEventListener() {
175 @Override
176 public void init(final GLAutoDrawable drawable) {
177 GL _gl = drawable.getGL();
178 if(forceDebug) {
179 try {
180 _gl = _gl.getContext().setGL( GLPipelineFactory.create("com.jogamp.opengl.Debug", null, _gl, null) );
181 } catch (final Exception e) {e.printStackTrace();}
182 }
183
184 if(forceTrace) {
185 try {
186 // Trace ..
187 _gl = _gl.getContext().setGL( GLPipelineFactory.create("com.jogamp.opengl.Trace", null, _gl, new Object[] { System.err } ) );
188 } catch (final Exception e) {e.printStackTrace();}
189 }
190 }
191 @Override
192 public void dispose(final GLAutoDrawable drawable) {}
193 @Override
194 public void display(final GLAutoDrawable drawable) {}
195 @Override
196 public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
197 });
198 }
199
200 if( null != demo ) {
201 glWindow.addGLEventListener(demo);
202 }
203
204 if(waitForKey) {
205 glWindow.addGLEventListener(new GLEventListener() {
206 @Override
207 public void init(final GLAutoDrawable drawable) { }
208 @Override
209 public void dispose(final GLAutoDrawable drawable) { }
210 @Override
211 public void display(final GLAutoDrawable drawable) {
212 final GLAnimatorControl actrl = drawable.getAnimator();
213 if(waitForKey && actrl.getTotalFPSFrames() == 60*3) {
214 MiscUtils.waitForKey("3s mark");
215 actrl.resetFPSCounter();
216 waitForKey = false;
217 }
218 }
219 @Override
220 public void reshape(final GLAutoDrawable drawable, final int x, final int y,
221 final int width, final int height) { }
222 });
223 }
224
225 final Animator animator = useAnimator ? new Animator(0 /* w/o AWT */) : null;
226 if( useAnimator ) {
227 animator.setExclusiveContext(exclusiveContext);
228 }
229
230 glWindow.addWindowListener(new WindowAdapter() {
231 @Override
232 public void windowResized(final WindowEvent e) {
233 System.err.println("window resized: "+glWindow.getBounds()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
234 NEWTDemoListener.setTitle(glWindow);
235 }
236 @Override
237 public void windowMoved(final WindowEvent e) {
238 System.err.println("window moved: "+glWindow.getBounds()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
239 NEWTDemoListener.setTitle(glWindow);
240 }
241 });
242
243 final NEWTDemoListener newtDemoListener;
244 {
245 final PointerIcon[] pointerIcon = useMultiplePointerIcon ? NEWTDemoListener.createPointerIcons(glWindow.getScreen().getDisplay()) : null;
246 newtDemoListener = new NEWTDemoListener(glWindow, pointerIcon);
247 }
248 newtDemoListener.quitAdapterEnable(true);
249 glWindow.addKeyListener(newtDemoListener);
250 if( traceMouse ) {
251 glWindow.addMouseListener(new TraceMouseAdapter());
252 }
253 glWindow.addMouseListener(newtDemoListener);
254 glWindow.addWindowListener(newtDemoListener);
255
256 if( useAnimator ) {
257 animator.add(glWindow);
258 animator.start();
259 }
260
261 glWindow.setVisible(true);
262 if( useAnimator ) {
263 animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
264 } else {
265 glWindow.setUpdateFPSFrames(60, showFPS ? System.err : null);
266 }
267
268 System.err.println("Window Current State : "+glWindow.getStateMaskString());
269 System.err.println("Window Supported States: "+glWindow.getSupportedStateMaskString());
270 System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
271 System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
272 System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
273
274 final float[] hasSurfacePixelScale1 = glWindow.getCurrentSurfaceScale(new float[2]);
275 System.err.println("HiDPI PixelScale: "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
276 valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
277 hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
278 NEWTDemoListener.setTitle(glWindow);
279
280 if( null != rwsize ) {
281 Thread.sleep(500); // 500ms delay
282 glWindow.setSize(rwsize.getWidth(), rwsize.getHeight());
283 System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
284 }
285
286 final long t0 = System.currentTimeMillis();
287 long t1 = t0;
288 while(!newtDemoListener.shouldQuit() && t1-t0<duration) {
289 if(!useAnimator) {
290 glWindow.display();
291 Thread.yield();
292 } else {
293 Thread.sleep(100);
294 }
295 t1 = System.currentTimeMillis();
296 }
297
298 if( useAnimator ) {
299 animator.stop();
300 }
301 glWindow.destroy();
302 }
303
304 public static void main(final String args[]) throws IOException {
305 int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
306 boolean usePos = false;
307
308 for(int i=0; i<args.length; i++) {
309 if(args[i].equals("-demo") && i+1<args.length) {
310 demoName = args[++i];
311 } else if(args[i].equals("-time")) {
312 i++;
313 duration = MiscUtils.atol(args[i], duration);
314 } else if(args[i].equals("-translucent")) {
315 opaque = false;
316 } else if(args[i].equals("-forceAlpha")) {
317 i++;
318 forceAlpha = MiscUtils.atoi(args[i], 0);
319 } else if(args[i].equals("-undecorated")) {
320 undecorated = true;
321 } else if(args[i].equals("-atop")) {
322 alwaysOnTop = true;
323 } else if(args[i].equals("-abottom")) {
324 alwaysOnBottom = true;
325 } else if(args[i].equals("-noresize")) {
326 resizable = false;
327 } else if(args[i].equals("-sticky")) {
328 sticky = true;
329 } else if(args[i].equals("-maxv")) {
330 max_vert = true;
331 } else if(args[i].equals("-maxh")) {
332 max_horz = true;
333 } else if(args[i].equals("-fullscreen")) {
334 fullscreen = true;
335 } else if(args[i].equals("-vsync")) {
336 i++;
337 swapInterval = MiscUtils.atoi(args[i], swapInterval);
338 } else if(args[i].equals("-single")) {
339 useDoubleBuffer = false;
340 } else if(args[i].equals("-exclctx")) {
341 exclusiveContext = true;
342 } else if(args[i].equals("-noanim")) {
343 useAnimator = false;
344 } else if(args[i].equals("-es2")) {
345 forceES2 = true;
346 } else if(args[i].equals("-es3")) {
347 forceES3 = true;
348 } else if(args[i].equals("-gl3")) {
349 forceGL3 = true;
350 } else if(args[i].equals("-gl2")) {
351 forceGL2 = true;
352 } else if(args[i].equals("-debug")) {
353 forceDebug = true;
354 } else if(args[i].equals("-trace")) {
355 forceTrace = true;
356 } else if(args[i].equals("-wait")) {
357 waitForKey = true;
358 } else if(args[i].equals("-mouseInvisible")) {
359 mouseVisible = false;
360 } else if(args[i].equals("-mouseConfine")) {
361 mouseConfined = true;
362 } else if(args[i].equals("-noPointerIcons")) {
363 useMultiplePointerIcon = false;
364 } else if(args[i].equals("-showFPS")) {
365 showFPS = true;
366 } else if(args[i].equals("-width")) {
367 i++;
368 w = MiscUtils.atoi(args[i], w);
369 } else if(args[i].equals("-height")) {
370 i++;
371 h = MiscUtils.atoi(args[i], h);
372 } else if(args[i].equals("-x")) {
373 i++;
374 x = MiscUtils.atoi(args[i], x);
375 usePos = true;
376 } else if(args[i].equals("-y")) {
377 i++;
378 y = MiscUtils.atoi(args[i], y);
379 usePos = true;
380 } else if(args[i].equals("-pixelScale")) {
381 i++;
382 final float pS = MiscUtils.atof(args[i], reqSurfacePixelScale[0]);
383 reqSurfacePixelScale[0] = pS;
384 reqSurfacePixelScale[1] = pS;
385 } else if(args[i].equals("-rwidth")) {
386 i++;
387 rw = MiscUtils.atoi(args[i], rw);
388 } else if(args[i].equals("-rheight")) {
389 i++;
390 rh = MiscUtils.atoi(args[i], rh);
391 } else if(args[i].equals("-screen")) {
392 i++;
393 screenIdx = MiscUtils.atoi(args[i], 0);
394 } else if(args[i].equals("-traceMouse")) {
395 traceMouse = true;
396 }
397 }
398 wsize = new Dimension(w, h);
399 if( 0 < rw && 0 < rh ) {
400 rwsize = new Dimension(rw, rh);
401 }
402
403 if(usePos) {
404 wpos = new Point(x, y);
405 }
406 System.err.println("demo "+demoName);
407 System.err.println("position "+wpos);
408 System.err.println("size "+wsize);
409 System.err.println("resize "+rwsize);
410 System.err.println("screen "+screenIdx);
411 System.err.println("translucent "+(!opaque));
412 System.err.println("forceAlpha "+forceAlpha);
413 System.err.println("undecorated "+undecorated);
414 System.err.println("atop "+alwaysOnTop);
415 System.err.println("abottom "+alwaysOnBottom);
416 System.err.println("resizable "+resizable);
417 System.err.println("sticky "+sticky);
418 System.err.println("max_vert "+max_vert);
419 System.err.println("max_horz "+max_horz);
420 System.err.println("fullscreen "+fullscreen);
421 System.err.println("mouseVisible "+mouseVisible);
422 System.err.println("mouseConfined "+mouseConfined);
423 System.err.println("pointerIcons "+useMultiplePointerIcon);
424 System.err.println("forceES2 "+forceES2);
425 System.err.println("forceES3 "+forceES3);
426 System.err.println("forceGL3 "+forceGL3);
427 System.err.println("forceGL2 "+forceGL2);
428 System.err.println("forceDebug "+forceDebug);
429 System.err.println("forceTrace "+forceTrace);
430 System.err.println("useDoubleBuffer "+useDoubleBuffer);
431 System.err.println("swapInterval "+swapInterval);
432 System.err.println("exclusiveContext "+exclusiveContext);
433 System.err.println("useAnimator "+useAnimator);
434 System.err.println("traceMouse "+traceMouse);
435
436 if(waitForKey) {
437 MiscUtils.waitForKey("Start");
438 }
439
440 final Launcher0 l = new Launcher0();
441 try {
442 System.err.println("Start-Demo");
443 l.runTest();
444 System.err.println("End-Demo");
445 } catch (final InterruptedException e) {
446 e.printStackTrace();
447 }
448 if(waitForKey) {
449 MiscUtils.waitForKey("End-Pre-Shutdown");
450 }
451 System.err.println("End-Pre-Shutdown");
453 System.err.println("End-Post-Shutdown");
454 }
455}
void setBackgroundOpaque(final boolean opaque)
Sets whether the surface shall be opaque or translucent.
void setAlphaBits(final int alphaBits)
Sets the number of bits requested for the color buffer's alpha component.
static Display createDisplay(final String name)
Create a Display entity.
static Screen createScreen(final Display display, final int index)
Create a Screen entity.
A screen may span multiple MonitorDevices representing their combined virtual size.
Definition: Screen.java:58
abstract Display getDisplay()
NEWT Window events are provided for notification purposes ONLY.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
Definition: GLWindow.java:121
final String getStateMaskString()
Returns a string representation of the current state mask.
Definition: GLWindow.java:246
final int getSurfaceHeight()
Returns the height of this GLDrawable's surface client area in pixel units.
Definition: GLWindow.java:466
final void setPointerVisible(final boolean mouseVisible)
Makes the pointer visible or invisible.
Definition: GLWindow.java:312
final void addMouseListener(final MouseListener l)
Appends the given MouseListener to the end of the list.
Definition: GLWindow.java:927
final void setPosition(final int x, final int y)
Sets the location of the window's client area excluding insets (window decorations) in window units.
Definition: GLWindow.java:525
final void setAlwaysOnTop(final boolean value)
Definition: GLWindow.java:351
final float[] getRequestedSurfaceScale(final float[] result)
Returns the requested pixel scale of the associated NativeSurface.
Definition: GLWindow.java:500
final void setMaximized(final boolean horz, final boolean vert)
Definition: GLWindow.java:391
final int getX()
Returns the current x position of this window, relative to it's parent.
Definition: GLWindow.java:436
final void addKeyListener(final KeyListener l)
Appends the given com.jogamp.newt.event.KeyListener to the end of the list.
Definition: GLWindow.java:902
final int getY()
Returns the current y position of the top-left corner of the client area relative to it's parent in w...
Definition: GLWindow.java:441
final float[] getCurrentSurfaceScale(final float[] result)
Returns the current pixel scale of the associated NativeSurface.
Definition: GLWindow.java:505
final int getSurfaceWidth()
Returns the width of this GLDrawable's surface client area in pixel units.
Definition: GLWindow.java:461
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
Definition: GLWindow.java:625
final String getSupportedStateMaskString()
Returns a string representation of the supported state mask.
Definition: GLWindow.java:256
final boolean setFullscreen(final boolean fullscreen)
Enable or disable fullscreen mode for this window.
Definition: GLWindow.java:534
final void setAlwaysOnBottom(final boolean value)
Definition: GLWindow.java:361
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
Definition: GLWindow.java:615
final Rectangle getBounds()
Returns a newly created Rectangle containing window origin, getX() & getY(), and size,...
Definition: GLWindow.java:456
final void addWindowListener(final WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
Definition: GLWindow.java:882
final void setSticky(final boolean value)
Definition: GLWindow.java:381
final CapabilitiesImmutable getChosenCapabilities()
Gets an immutable set of chosen capabilities.
Definition: GLWindow.java:266
final void setResizable(final boolean value)
Definition: GLWindow.java:371
final InsetsImmutable getInsets()
Returns the insets defined as the width and height of the window decoration on the left,...
Definition: GLWindow.java:431
final void setUndecorated(final boolean value)
Definition: GLWindow.java:337
final boolean setSurfaceScale(final float[] pixelScale)
Request a pixel scale in x- and y-direction for the associated NativeSurface, where size_in_pixel_uni...
Definition: GLWindow.java:495
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
Definition: GLWindow.java:605
final Window getDelegatedWindow()
If the implementation uses delegation, return the delegated Window instance, otherwise return this in...
Definition: GLWindow.java:277
final void confinePointer(final boolean grab)
Confine the pointer to this window, ie.
Definition: GLWindow.java:332
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Definition: GLWindow.java:169
static PointerIcon[] createPointerIcons(final Display disp)
Specifies a set of OpenGL capabilities.
void setDoubleBuffered(final boolean enable)
Enables or disables double buffering.
abstract GL setGL(GL gl)
Sets the GL pipeline object for this GLContext.
Factory for pipelining GL instances.
static final GL create(final String pipelineClazzBaseName, final Class<?> reqInterface, final GL downstream, final Object[] additionalArgs)
Creates a pipelined GL instance using the given downstream downstream and optional arguments addition...
Specifies the the OpenGL profile.
Definition: GLProfile.java:77
static final String GLES3
The embedded OpenGL profile ES 3.x, with x >= 0.
Definition: GLProfile.java:588
static final String GL3
The desktop OpenGL core profile 3.x, with x >= 1.
Definition: GLProfile.java:576
static void shutdown()
Manual shutdown method, may be called after your last JOGL use within the running JVM.
Definition: GLProfile.java:277
static final String GLES2
The embedded OpenGL profile ES 2.x, with x >= 0.
Definition: GLProfile.java:585
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
static final String GL2
The desktop OpenGL profile 1.x up to 3.0.
Definition: GLProfile.java:579
static GLProfile getGL2ES2(final AbstractGraphicsDevice device)
Returns the GL2ES2 profile implementation, hence compatible w/ GL2ES2.
Definition: GLProfile.java:913
static void main(final String args[])
Definition: Launcher0.java:304
static void waitForKey(final String preMessage)
Definition: MiscUtils.java:167
static int atoi(final String str, final int def)
Definition: MiscUtils.java:60
static float atof(final String str, final float def)
Definition: MiscUtils.java:78
static long atol(final String str, final long def)
Definition: MiscUtils.java:69
final synchronized void add(final GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.
final synchronized Thread setExclusiveContext(final Thread t)
Dedicate all GLAutoDrawable's context to the given exclusive context thread.
final void setUpdateFPSFrames(final int frames, final PrintStream out)
final synchronized boolean start()
Starts this animator, if not running.
Definition: Animator.java:344
final synchronized boolean stop()
Stops this animator.
Definition: Animator.java:368
Adding mutable surface pixel scale property to implementing class, usually to a NativeSurface impleme...
static final float AUTOMAX_PIXELSCALE
Setting surface-pixel-scale of {@value}, results in maximum platform dependent pixel-scale,...
Immutable Dimension Interface, consisting of it's read only components:
Native PointerIcon handle.
Definition: Display.java:92
CapabilitiesImmutable getChosenCapabilities()
Gets an immutable set of chosen capabilities.
void setUpdateFPSFrames(int frames, PrintStream out)
void resetFPSCounter()
Reset all performance counter (startTime, currentTime, frame number)
An animator control interface, which implementation may drive a com.jogamp.opengl....
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GLAnimatorControl getAnimator()
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
GLContext getContext()
Returns the GLContext associated which this GL object.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.