JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java
Go to the documentation of this file.
1/**
2 * Copyright 2010 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.test.junit.jogl.acore;
30
31import java.io.IOException;
32
33import com.jogamp.nativewindow.CapabilitiesImmutable;
34import com.jogamp.opengl.GLAutoDrawable;
35import com.jogamp.opengl.GLCapabilities;
36import com.jogamp.opengl.GLCapabilitiesImmutable;
37import com.jogamp.opengl.GLContext;
38import com.jogamp.opengl.GLDrawable;
39import com.jogamp.opengl.GLDrawableFactory;
40import com.jogamp.opengl.GLEventListener;
41import com.jogamp.opengl.GLProfile;
42
43import jogamp.opengl.GLGraphicsConfigurationUtil;
44
45import org.junit.Assert;
46import org.junit.Test;
47import org.junit.FixMethodOrder;
48import org.junit.runners.MethodSorters;
49
50import com.jogamp.newt.opengl.GLWindow;
51import com.jogamp.opengl.JoglVersion;
52import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
53import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
54import com.jogamp.opengl.test.junit.util.GLTestUtil;
55import com.jogamp.opengl.test.junit.util.NewtTestUtil;
56import com.jogamp.opengl.test.junit.util.UITestCase;
57
58/**
59 * Tests using a NEWT {@link GLWindow} {@link GLAutoDrawable auto drawable} for on- and offscreen cases.
60 * <p>
61 * The NEWT {@link GLAutoDrawable} is being used to run the {@link GLEventListener}.
62 * </p>
63 */
64@FixMethodOrder(MethodSorters.NAME_ASCENDING)
66 static final int widthStep = 800/4;
67 static final int heightStep = 600/4;
68 volatile int szStep = 2;
69
70 static interface MyGLEventListener extends GLEventListener {
71 void setMakeSnapshot();
72 }
73
74 static GLCapabilities getCaps(final String profile) {
75 if( !GLProfile.isAvailable(profile) ) {
76 System.err.println("Profile "+profile+" n/a");
77 return null;
78 }
79 return new GLCapabilities(GLProfile.get(profile));
80 }
81
82 void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
83 System.out.println("Requested GL Caps: "+reqGLCaps);
85 final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
86 System.out.println("Expected GL Caps: "+expGLCaps);
87 //
88 // Create native windowing resources .. X11/Win/OSX
89 //
90 final GLWindow glad = GLWindow.create(reqGLCaps);
91 Assert.assertNotNull(glad);
92 glad.setSize(widthStep*szStep, heightStep*szStep);
93 glad.setVisible(true);
94 Assert.assertTrue(NewtTestUtil.waitForVisible(glad, true, null));
95 Assert.assertTrue(NewtTestUtil.waitForRealized(glad, true, null));
96 System.out.println("Window: "+glad.getClass().getName());
97
98 // Check caps of NativeWindow config w/o GL
100 System.out.println("Window Caps Pre_GL: "+chosenCaps);
101 Assert.assertNotNull(chosenCaps);
102 Assert.assertTrue(chosenCaps.getGreenBits()>5);
103 Assert.assertTrue(chosenCaps.getBlueBits()>5);
104 Assert.assertTrue(chosenCaps.getRedBits()>5);
105
106 //
107 // Create native OpenGL resources .. XGL/WGL/CGL ..
108 // equivalent to GLAutoDrawable methods: setVisible(true)
109 //
110 {
111 final GLDrawable actualDrawable = glad.getDelegatedDrawable();
112 Assert.assertNotNull(actualDrawable);
113 System.out.println("Drawable Pre-GL(0): "+actualDrawable.getClass().getName()+", "+actualDrawable.getNativeSurface().getClass().getName());
114 }
115
116 System.out.println("Window Caps PostGL : "+glad.getGraphicsConfiguration().getChosenCapabilities());
117 System.out.println("Drawable Post-GL(1): "+glad.getClass().getName()+", "+glad.getNativeSurface().getClass().getName());
118
119 // Check caps of GLDrawable after realization
120 final GLCapabilitiesImmutable chosenGLCaps = glad.getChosenGLCapabilities();
121 System.out.println("Chosen GL Caps(1): "+chosenGLCaps);
122 Assert.assertNotNull(chosenGLCaps);
123 Assert.assertTrue(chosenGLCaps.getGreenBits()>5);
124 Assert.assertTrue(chosenGLCaps.getBlueBits()>5);
125 Assert.assertTrue(chosenGLCaps.getRedBits()>5);
126 Assert.assertTrue(chosenGLCaps.getDepthBits()>4);
127 Assert.assertEquals(expGLCaps.isOnscreen(), chosenGLCaps.isOnscreen());
128 Assert.assertEquals(expGLCaps.isFBO(), chosenGLCaps.isFBO());
129 Assert.assertEquals(expGLCaps.isPBuffer(), chosenGLCaps.isPBuffer());
130 Assert.assertEquals(expGLCaps.isBitmap(), chosenGLCaps.isBitmap());
131 /** Single/Double buffer cannot be checked since result may vary ..
132 if(chosenGLCaps.isOnscreen() || chosenGLCaps.isFBO()) {
133 // dbl buffer may be disabled w/ offscreen pbuffer and bitmap
134 Assert.assertEquals(expGLCaps.getDoubleBuffered(), chosenGLCaps.getDoubleBuffered());
135 } */
136
137 glad.display();
138 {
139 final GLContext context = glad.getContext();
140 System.out.println("Chosen GL CTX (2): "+context.getGLVersion());
141 Assert.assertNotNull(context);
142 Assert.assertTrue(context.isCreated());
143 }
144
145 System.out.println("Chosen GL Caps(2): "+glad.getChosenGLCapabilities());
146 System.out.println("Drawable Post-GL(2): "+glad.getClass().getName()+", "+glad.getNativeSurface().getClass().getName());
147
148 glad.addGLEventListener(demo);
149
150 final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
151 glad.addGLEventListener(snapshotGLEventListener);
152
153 glad.display(); // initial resize/display
154
155 // 1 - szStep = 2
156 final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep });
157 Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
158 GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null));
159 snapshotGLEventListener.setMakeSnapshot();
160 glad.display();
161
162 // 2, 3 (resize + display)
163 szStep = 1;
164 glad.setSize(widthStep*szStep, heightStep*szStep);
165 expSurfaceSize[0] = widthStep*szStep;
166 expSurfaceSize[1] = heightStep*szStep;
167 glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
168 Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
169 GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null));
170 snapshotGLEventListener.setMakeSnapshot();
171 glad.display();
172
173 // 4, 5 (resize + display)
174 szStep = 4;
175 glad.setSize(widthStep*szStep, heightStep*szStep);
176 expSurfaceSize[0] = widthStep*szStep;
177 expSurfaceSize[1] = heightStep*szStep;
178 glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
179 Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
180 GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null));
181 snapshotGLEventListener.setMakeSnapshot();
182 glad.display();
183
184 Thread.sleep(50);
185
186 glad.destroy();
187 System.out.println("Fin: "+glad);
188 }
189
190 @Test
191 public void testGL2OnScreenSglBuf() throws InterruptedException {
192 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
193 if(null == reqGLCaps) return;
194 reqGLCaps.setDoubleBuffered(false);
195 doTest(reqGLCaps, new GearsES2(1));
196 }
197
198 @Test
199 public void testGL2OnScreenDblBuf() throws InterruptedException {
200 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
201 if(null == reqGLCaps) return;
202 doTest(reqGLCaps, new GearsES2(1));
203 }
204
205 @Test
206 public void testGL2OnScreenDblBufStencil() throws InterruptedException {
207 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
208 if(null == reqGLCaps) return;
209 reqGLCaps.setStencilBits(1);
210 doTest(reqGLCaps, new GearsES2(1));
211 }
212
213 @Test
214 public void testGL2OnScreenDblBufMSAA() throws InterruptedException {
215 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
216 if(null == reqGLCaps) return;
217 reqGLCaps.setSampleBuffers(true);
218 reqGLCaps.setNumSamples(4);
219 doTest(reqGLCaps, new GearsES2(1));
220 }
221
222 @Test
223 public void testGL2OnScreenDblBufStencilMSAA() throws InterruptedException {
224 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
225 if(null == reqGLCaps) return;
226 reqGLCaps.setStencilBits(1);
227 reqGLCaps.setSampleBuffers(true);
228 reqGLCaps.setNumSamples(4);
229 doTest(reqGLCaps, new GearsES2(1));
230 }
231
232 @Test
233 public void testGL2OffScreenAutoDblBuf() throws InterruptedException {
234 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
235 if(null == reqGLCaps) return;
236 reqGLCaps.setOnscreen(false);
237 doTest(reqGLCaps, new GearsES2(1));
238 }
239
240 @Test
241 public void testGL2OffScreenFBOSglBuf() throws InterruptedException {
242 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
243 if(null == reqGLCaps) return;
244 reqGLCaps.setOnscreen(false);
245 reqGLCaps.setFBO(true);
246 reqGLCaps.setDoubleBuffered(false);
247 doTest(reqGLCaps, new GearsES2(1));
248 }
249
250 @Test
251 public void testGL2OffScreenFBODblBuf() throws InterruptedException {
252 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
253 if(null == reqGLCaps) return;
254 reqGLCaps.setOnscreen(false);
255 reqGLCaps.setFBO(true);
256 doTest(reqGLCaps, new GearsES2(1));
257 }
258
259 @Test
260 public void testGL2OffScreenFBODblBufStencil() throws InterruptedException {
261 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
262 if(null == reqGLCaps) return;
263 reqGLCaps.setOnscreen(false);
264 reqGLCaps.setFBO(true);
265 reqGLCaps.setStencilBits(1);
266 doTest(reqGLCaps, new GearsES2(1));
267 }
268
269 @Test
270 public void testGL2OffScreenFBODblBufMSAA() throws InterruptedException {
271 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
272 if(null == reqGLCaps) return;
273 reqGLCaps.setOnscreen(false);
274 reqGLCaps.setFBO(true);
275 reqGLCaps.setSampleBuffers(true);
276 reqGLCaps.setNumSamples(4);
277 doTest(reqGLCaps, new GearsES2(1));
278 }
279
280 @Test
281 public void testGL2OffScreenFBODblBufStencilMSAA() throws InterruptedException {
282 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
283 if(null == reqGLCaps) return;
284 reqGLCaps.setOnscreen(false);
285 reqGLCaps.setFBO(true);
286 reqGLCaps.setStencilBits(1);
287 reqGLCaps.setSampleBuffers(true);
288 reqGLCaps.setNumSamples(4);
289 doTest(reqGLCaps, new GearsES2(1));
290 }
291
292 @Test
293 public void testGL2OffScreenPbufferDblBuf() throws InterruptedException {
294 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
295 if(null == reqGLCaps) return;
296 reqGLCaps.setOnscreen(false);
297 reqGLCaps.setPBuffer(true);
298 doTest(reqGLCaps, new GearsES2(1));
299 }
300
301 @Test
302 public void testGL2OffScreenPbufferSglBuf() throws InterruptedException {
303 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
304 if(null == reqGLCaps) return;
305 reqGLCaps.setOnscreen(false);
306 reqGLCaps.setPBuffer(true);
307 reqGLCaps.setDoubleBuffered(false);
308 doTest(reqGLCaps, new GearsES2(1));
309 }
310
311 @Test
312 public void testGL2OffScreenBitmapSglBuf() throws InterruptedException {
313 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
314 if(null == reqGLCaps) return;
315 reqGLCaps.setOnscreen(false);
316 reqGLCaps.setBitmap(true);
317 reqGLCaps.setDoubleBuffered(false);
318 doTest(reqGLCaps, new Gears(1));
319 }
320
321 @Test
322 public void testES2OnScreenSglBuf() throws InterruptedException {
323 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
324 if(null == reqGLCaps) return;
325 reqGLCaps.setDoubleBuffered(false);
326 doTest(reqGLCaps, new GearsES2(1));
327 }
328
329 @Test
330 public void testES2OnScreenDblBuf() throws InterruptedException {
331 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
332 if(null == reqGLCaps) return;
333 doTest(reqGLCaps, new GearsES2(1));
334 }
335
336 @Test
337 public void testES2OnScreenDblBufStencil() throws InterruptedException {
338 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
339 if(null == reqGLCaps) return;
340 reqGLCaps.setStencilBits(1);
341 doTest(reqGLCaps, new GearsES2(1));
342 }
343
344 @Test
345 public void testES2OnScreenDblBufMSAA() throws InterruptedException {
346 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
347 if(null == reqGLCaps) return;
348 reqGLCaps.setSampleBuffers(true);
349 reqGLCaps.setNumSamples(4);
350 doTest(reqGLCaps, new GearsES2(1));
351 }
352
353 @Test
354 public void testES2OnScreenDblBufStencilMSAA() throws InterruptedException {
355 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
356 if(null == reqGLCaps) return;
357 reqGLCaps.setStencilBits(1);
358 reqGLCaps.setSampleBuffers(true);
359 reqGLCaps.setNumSamples(4);
360 doTest(reqGLCaps, new GearsES2(1));
361 }
362
363 @Test
364 public void testES2OffScreenAutoDblBuf() throws InterruptedException {
365 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
366 if(null == reqGLCaps) return;
367 reqGLCaps.setOnscreen(false);
368 doTest(reqGLCaps, new GearsES2(1));
369 }
370
371 @Test
372 public void testES2OffScreenFBOSglBuf() throws InterruptedException {
373 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
374 if(null == reqGLCaps) return;
375 reqGLCaps.setOnscreen(false);
376 reqGLCaps.setFBO(true);
377 reqGLCaps.setDoubleBuffered(false);
378 doTest(reqGLCaps, new GearsES2(1));
379 }
380
381 @Test
382 public void testES2OffScreenFBODblBuf() throws InterruptedException {
383 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
384 if(null == reqGLCaps) return;
385 reqGLCaps.setOnscreen(false);
386 reqGLCaps.setFBO(true);
387 doTest(reqGLCaps, new GearsES2(1));
388 }
389
390 @Test
391 public void testES2OffScreenFBODblBufStencil() throws InterruptedException {
392 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
393 if(null == reqGLCaps) return;
394 reqGLCaps.setOnscreen(false);
395 reqGLCaps.setFBO(true);
396 reqGLCaps.setStencilBits(1);
397 doTest(reqGLCaps, new GearsES2(1));
398 }
399
400 @Test
401 public void testES2OffScreenFBODblBufMSAA() throws InterruptedException {
402 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
403 if(null == reqGLCaps) return;
404 reqGLCaps.setOnscreen(false);
405 reqGLCaps.setFBO(true);
406 reqGLCaps.setSampleBuffers(true);
407 reqGLCaps.setNumSamples(4);
408 doTest(reqGLCaps, new GearsES2(1));
409 }
410
411 @Test
412 public void testES2OffScreenFBODblBufStencilMSAA() throws InterruptedException {
413 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
414 if(null == reqGLCaps) return;
415 reqGLCaps.setOnscreen(false);
416 reqGLCaps.setFBO(true);
417 reqGLCaps.setStencilBits(1);
418 reqGLCaps.setSampleBuffers(true);
419 reqGLCaps.setNumSamples(4);
420 doTest(reqGLCaps, new GearsES2(1));
421 }
422
423 @Test
424 public void testES2OffScreenPbufferDblBuf() throws InterruptedException {
425 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
426 if(null == reqGLCaps) return;
427 reqGLCaps.setOnscreen(false);
428 reqGLCaps.setPBuffer(true);
429 doTest(reqGLCaps, new GearsES2(1));
430 }
431
432 @Test
433 public void testES2OffScreenPbufferSglBuf() throws InterruptedException {
434 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
435 if(null == reqGLCaps) return;
436 reqGLCaps.setOnscreen(false);
437 reqGLCaps.setPBuffer(true);
438 reqGLCaps.setDoubleBuffered(false);
439 doTest(reqGLCaps, new GearsES2(1));
440 }
441
442 /** Not implemented !
443 @Test
444 public void testES2OffScreenBitmapDblBuf() throws InterruptedException {
445 if(!checkProfile(GLProfile.GLES2)) {
446 return;
447 }
448 final GLCapabilities reqGLCaps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
449 reqGLCaps.setOnscreen(false);
450 reqGLCaps.setBitmap(true);
451 doTest(reqGLCaps, new GearsES2(1));
452 } */
453
454 public static void main(final String args[]) throws IOException {
455 org.junit.runner.JUnitCore.main(TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.class.getName());
456 }
457
458}
void setBitmap(final boolean enable)
Requesting offscreen bitmap mode.
void setOnscreen(final boolean onscreen)
Sets whether the surface shall be on- or offscreen.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
Definition: GLWindow.java:121
final int getSurfaceHeight()
Returns the height of this GLDrawable's surface client area in pixel units.
Definition: GLWindow.java:466
final AbstractGraphicsConfiguration getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window.
Definition: GLWindow.java:1052
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 void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
Definition: GLWindow.java:615
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
Definition: GLWindow.java:605
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
Specifies a set of OpenGL capabilities.
void setPBuffer(final boolean enable)
Requesting offscreen pbuffer mode.
void setStencilBits(final int stencilBits)
Sets the number of bits requested for the stencil buffer.
void setDoubleBuffered(final boolean enable)
Enables or disables double buffering.
void setFBO(final boolean enable)
Requesting offscreen FBO mode.
void setNumSamples(final int numSamples)
If sample buffers are enabled, indicates the number of buffers to be allocated.
void setSampleBuffers(final boolean enable)
Defaults to false.
Abstraction for an OpenGL rendering context.
Definition: GLContext.java:74
final boolean isCreated()
Indicates whether the underlying native OpenGL context has been created.
Definition: GLContext.java:604
final String getGLVersion()
Returns a valid OpenGL version string, ie
Definition: GLContext.java:769
static GLDrawableFactory getFactory(final GLProfile glProfile)
Returns the sole GLDrawableFactory instance.
Specifies the the OpenGL profile.
Definition: GLProfile.java:77
static boolean isAvailable(final AbstractGraphicsDevice device, final String profile)
Returns the availability of a profile on a device.
Definition: GLProfile.java:305
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 void main(final String args[])
Not implemented ! @Test public void testES2OffScreenBitmapDblBuf() throws InterruptedException { if(!...
Gears.java author: Brian Paul (converted to Java by Ron Cemer and Sven Gothel)
Definition: Gears.java:34
static boolean waitForSize(final GLDrawable drawable, final int width, final int height, final Runnable waitAction)
Definition: GLTestUtil.java:72
static boolean waitForRealized(final Screen screen, final boolean realized, final Runnable waitAction)
static boolean waitForVisible(final Window win, final boolean visible, final Runnable waitAction)
CapabilitiesImmutable getChosenCapabilities()
Return the capabilities reflecting this graphics configuration, which may differ from the capabilitie...
Specifies an immutable set of capabilities that a window's rendering context must support,...
int getBlueBits()
Returns the number of bits for the color buffer's blue component.
boolean isBitmap()
Returns whether bitmap offscreen mode is requested, available or chosen.
int getRedBits()
Returns the number of bits for the color buffer's red component.
int getGreenBits()
Returns the number of bits for the color buffer's green component.
boolean isOnscreen()
Returns whether an on- or offscreen surface is requested, available or chosen.
int[] convertToPixelUnits(final int[] windowUnitsAndResult)
Converts the given window units into pixel units in place.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
GLContext getContext()
Returns the context associated with this drawable.
GLDrawable getDelegatedDrawable()
If the implementation uses delegation, return the delegated GLDrawable instance, otherwise return thi...
Specifies an immutable set of OpenGL capabilities.
int getDepthBits()
Returns the number of depth buffer bits.
boolean isPBuffer()
Returns whether pbuffer offscreen mode is requested, available or chosen.
GLProfile getGLProfile()
Returns the GL profile you desire or used by the drawable.
boolean isFBO()
Returns whether FBO offscreen mode is requested, available or chosen.
An abstraction for an OpenGL rendering target.
Definition: GLDrawable.java:51
GLCapabilitiesImmutable getChosenGLCapabilities()
Fetches the GLCapabilitiesImmutable corresponding to the chosen OpenGL capabilities (pixel format / v...
NativeSurface getNativeSurface()
Returns the associated NativeSurface of this NativeSurfaceHolder.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.