JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.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.GLCapabilities;
35import com.jogamp.opengl.GLCapabilitiesImmutable;
36import com.jogamp.opengl.GLContext;
37import com.jogamp.opengl.GLDrawable;
38import com.jogamp.opengl.GLDrawableFactory;
39import com.jogamp.opengl.GLEventListener;
40import com.jogamp.opengl.GLProfile;
41
42import jogamp.opengl.GLGraphicsConfigurationUtil;
43
44import org.junit.Assert;
45import org.junit.Test;
46import org.junit.FixMethodOrder;
47import org.junit.runners.MethodSorters;
48
49import com.jogamp.newt.NewtFactory;
50import com.jogamp.newt.Window;
51import com.jogamp.newt.event.WindowAdapter;
52import com.jogamp.newt.event.WindowEvent;
53import com.jogamp.newt.event.WindowUpdateEvent;
54import com.jogamp.opengl.GLAutoDrawableDelegate;
55import com.jogamp.opengl.JoglVersion;
56import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
57import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
58import com.jogamp.opengl.test.junit.util.GLTestUtil;
59import com.jogamp.opengl.test.junit.util.NewtTestUtil;
60import com.jogamp.opengl.test.junit.util.UITestCase;
61
62/**
63 * Tests using a NEWT {@link Window} for on- and offscreen cases.
64 * <p>
65 * Each test creates a {@link GLDrawable} using the
66 * {@link GLDrawableFactory#createGLDrawable(com.jogamp.nativewindow.NativeSurface) factory model}.
67 * The {@link GLContext} is derived {@link GLDrawable#createContext(GLContext) from the drawable}.
68 * </p>
69 * <p>
70 * Finally a {@link GLAutoDrawableDelegate} is created with the just created {@link GLDrawable} and {@link GLContext}.
71 * It is being used to run the {@link GLEventListener}.
72 * </p>
73 */
74@FixMethodOrder(MethodSorters.NAME_ASCENDING)
76 static final int widthStep = 800/4;
77 static final int heightStep = 600/4;
78 volatile int szStep = 2;
79
80 static GLCapabilities getCaps(final String profile) {
81 if( !GLProfile.isAvailable(profile) ) {
82 System.err.println("Profile "+profile+" n/a");
83 return null;
84 }
85 return new GLCapabilities(GLProfile.get(profile));
86 }
87
88 void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
89 System.out.println("Requested GL Caps: "+reqGLCaps);
91 final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
92 System.out.println("Expected GL Caps: "+expGLCaps);
93 //
94 // Create native windowing resources .. X11/Win/OSX
95 //
96 final Window window = NewtFactory.createWindow(reqGLCaps);
97 Assert.assertNotNull(window);
98 window.setSize(widthStep*szStep, heightStep*szStep);
99 window.setVisible(true);
100 Assert.assertTrue(NewtTestUtil.waitForVisible(window, true, null));
101 Assert.assertTrue(NewtTestUtil.waitForRealized(window, true, null));
102 System.out.println("Window: "+window.getClass().getName());
103
104 // Check caps of NativeWindow config w/o GL
106 System.out.println("Window Caps Pre_GL: "+chosenCaps);
107 Assert.assertNotNull(chosenCaps);
108 Assert.assertTrue(chosenCaps.getGreenBits()>5);
109 Assert.assertTrue(chosenCaps.getBlueBits()>5);
110 Assert.assertTrue(chosenCaps.getRedBits()>5);
111
112 //
113 // Create native OpenGL resources .. XGL/WGL/CGL ..
114 // equivalent to GLAutoDrawable methods: setVisible(true)
115 //
116 final GLDrawable drawable = factory.createGLDrawable(window);
117 Assert.assertNotNull(drawable);
118 System.out.println("Drawable Pre-GL(0): "+drawable.getClass().getName()+", "+drawable.getNativeSurface().getClass().getName());
119
120 //
121 drawable.setRealized(true);
122 Assert.assertTrue(drawable.isRealized());
123
124 System.out.println("Window Caps PostGL : "+window.getGraphicsConfiguration().getChosenCapabilities());
125 System.out.println("Drawable Post-GL(1): "+drawable.getClass().getName()+", "+drawable.getNativeSurface().getClass().getName());
126
127 // Note: FBO Drawable realization happens at 1st context.makeCurrent(),
128 // and hence only then it's caps can _fully_ reflect expectations,
129 // i.e. depth, stencil and MSAA will be valid only after makeCurrent(),
130 // where on-/offscreen state after setRealized(true)
131 // See GLFBODrawable API doc in this regard!
132
133
134 final GLCapabilitiesImmutable chosenGLCaps01 = drawable.getChosenGLCapabilities();
135 System.out.println("Chosen GL Caps(1): "+chosenGLCaps01);
136 Assert.assertNotNull(chosenGLCaps01);
137 Assert.assertEquals(expGLCaps.isOnscreen(), chosenGLCaps01.isOnscreen());
138 Assert.assertEquals(expGLCaps.isFBO(), chosenGLCaps01.isFBO());
139 Assert.assertEquals(expGLCaps.isPBuffer(), chosenGLCaps01.isPBuffer());
140 Assert.assertEquals(expGLCaps.isBitmap(), chosenGLCaps01.isBitmap());
141
142 final GLContext context = drawable.createContext(null);
143 Assert.assertNotNull(context);
144 final int res = context.makeCurrent();
145 Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
146 context.release();
147
148 // Check caps of GLDrawable after realization
149 final GLCapabilitiesImmutable chosenGLCaps02 = drawable.getChosenGLCapabilities();
150 System.out.println("Chosen GL Caps(2): "+chosenGLCaps02);
151 System.out.println("Chosen GL CTX (2): "+context.getGLVersion());
152 System.out.println("Drawable Post-GL(2): "+drawable.getClass().getName()+", "+drawable.getNativeSurface().getClass().getName());
153 Assert.assertNotNull(chosenGLCaps02);
154 Assert.assertTrue(chosenGLCaps02.getGreenBits()>5);
155 Assert.assertTrue(chosenGLCaps02.getBlueBits()>5);
156 Assert.assertTrue(chosenGLCaps02.getRedBits()>5);
157 Assert.assertTrue(chosenGLCaps02.getDepthBits()>4);
158 Assert.assertEquals(expGLCaps.isOnscreen(), chosenGLCaps02.isOnscreen());
159 Assert.assertEquals(expGLCaps.isFBO(), chosenGLCaps02.isFBO());
160 Assert.assertEquals(expGLCaps.isPBuffer(), chosenGLCaps02.isPBuffer());
161 Assert.assertEquals(expGLCaps.isBitmap(), chosenGLCaps02.isBitmap());
162 /** Single/Double buffer cannot be checked since result may vary ..
163 if(chosenGLCaps.isOnscreen() || chosenGLCaps.isFBO()) {
164 // dbl buffer may be disabled w/ offscreen pbuffer and bitmap
165 Assert.assertEquals(expGLCaps.getDoubleBuffered(), chosenGLCaps.getDoubleBuffered());
166 } */
167
168 final GLAutoDrawableDelegate glad = new GLAutoDrawableDelegate(drawable, context, window, false, null) {
169 @Override
170 protected void destroyImplInLock() {
171 super.destroyImplInLock(); // destroys drawable/context
172 window.destroy(); // destroys the actual window, incl. the device
173 }
174 };
175
176 window.setWindowDestroyNotifyAction( new Runnable() {
177 public void run() {
179 } } );
180
181 window.addWindowListener(new WindowAdapter() {
182 @Override
183 public void windowRepaint(final WindowUpdateEvent e) {
184 glad.windowRepaintOp();
185 }
186
187 @Override
188 public void windowResized(final WindowEvent e) {
189 glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight());
190 }
191 });
192
193 glad.addGLEventListener(demo);
194
195 final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
196 glad.addGLEventListener(snapshotGLEventListener);
197
198 glad.display(); // initial resize/display
199
200 // 1 - szStep = 2
201 final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep });
202 Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
203 GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null));
204 snapshotGLEventListener.setMakeSnapshot();
205 glad.display();
206
207 // 2, 3 (resize + display)
208 szStep = 1;
209 window.setSize(widthStep*szStep, heightStep*szStep);
210 expSurfaceSize[0] = widthStep*szStep;
211 expSurfaceSize[1] = heightStep*szStep;
212 glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
213 Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
214 GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null));
215 snapshotGLEventListener.setMakeSnapshot();
216 glad.display();
217
218 // 4, 5 (resize + display)
219 szStep = 4;
220 window.setSize(widthStep*szStep, heightStep*szStep);
221 expSurfaceSize[0] = widthStep*szStep;
222 expSurfaceSize[1] = heightStep*szStep;
223 glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
224 Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
225 GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1], null));
226 snapshotGLEventListener.setMakeSnapshot();
227 glad.display();
228
229 Thread.sleep(50);
230
231 glad.destroy();
232 System.out.println("Fin Drawable: "+drawable);
233 System.out.println("Fin Window: "+window);
234 }
235
236 @Test
237 public void testAvailableInfo() {
239 if(null != f) {
240 System.err.println(JoglVersion.getDefaultOpenGLInfo(f.getDefaultDevice(), null, true).toString());
241 }
243 if(null != f) {
244 System.err.println(JoglVersion.getDefaultOpenGLInfo(f.getDefaultDevice(), null, true).toString());
245 }
246 }
247
248 @Test
249 public void testGL2OnScreenSglBuf() throws InterruptedException {
250 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
251 if(null == reqGLCaps) return;
252 reqGLCaps.setDoubleBuffered(false);
253 doTest(reqGLCaps, new GearsES2(1));
254 }
255
256 @Test
257 public void testGL2OnScreenDblBuf() throws InterruptedException {
258 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
259 if(null == reqGLCaps) return;
260 doTest(reqGLCaps, new GearsES2(1));
261 }
262
263 @Test
264 public void testGL2OffScreenAutoDblBuf() throws InterruptedException {
265 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
266 if(null == reqGLCaps) return;
267 reqGLCaps.setOnscreen(false);
268 doTest(reqGLCaps, new GearsES2(1));
269 }
270
271 @Test
272 public void testGL2OffScreenFBOSglBuf() throws InterruptedException {
273 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
274 if(null == reqGLCaps) return;
275 reqGLCaps.setOnscreen(false);
276 reqGLCaps.setFBO(true);
277 reqGLCaps.setDoubleBuffered(false);
278 doTest(reqGLCaps, new GearsES2(1));
279 }
280
281 @Test
282 public void testGL2OffScreenFBODblBuf() throws InterruptedException {
283 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
284 if(null == reqGLCaps) return;
285 reqGLCaps.setOnscreen(false);
286 reqGLCaps.setFBO(true);
287 doTest(reqGLCaps, new GearsES2(1));
288 }
289
290 @Test
291 public void testGL2OffScreenPbufferDblBuf() throws InterruptedException {
292 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
293 if(null == reqGLCaps) return;
294 reqGLCaps.setOnscreen(false);
295 reqGLCaps.setPBuffer(true);
296 doTest(reqGLCaps, new GearsES2(1));
297 }
298
299 @Test
300 public void testGL2OffScreenPbufferSglBuf() throws InterruptedException {
301 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
302 if(null == reqGLCaps) return;
303 reqGLCaps.setOnscreen(false);
304 reqGLCaps.setPBuffer(true);
305 reqGLCaps.setDoubleBuffered(false);
306 doTest(reqGLCaps, new GearsES2(1));
307 }
308
309 @Test
310 public void testGL2OffScreenBitmapSglBuf() throws InterruptedException {
311 final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
312 if(null == reqGLCaps) return;
313 reqGLCaps.setOnscreen(false);
314 reqGLCaps.setBitmap(true);
315 reqGLCaps.setDoubleBuffered(false);
316 doTest(reqGLCaps, new Gears(1));
317 }
318
319 @Test
320 public void testES2OnScreenSglBuf() throws InterruptedException {
321 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
322 if(null == reqGLCaps) return;
323 reqGLCaps.setDoubleBuffered(false);
324 doTest(reqGLCaps, new GearsES2(1));
325 }
326
327 @Test
328 public void testES2OnScreenDblBuf() throws InterruptedException {
329 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
330 if(null == reqGLCaps) return;
331 doTest(reqGLCaps, new GearsES2(1));
332 }
333
334 @Test
335 public void testES2OffScreenAutoDblBuf() throws InterruptedException {
336 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
337 if(null == reqGLCaps) return;
338 reqGLCaps.setOnscreen(false);
339 doTest(reqGLCaps, new GearsES2(1));
340 }
341
342 @Test
343 public void testES2OffScreenFBOSglBuf() throws InterruptedException {
344 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
345 if(null == reqGLCaps) return;
346 reqGLCaps.setOnscreen(false);
347 reqGLCaps.setFBO(true);
348 reqGLCaps.setDoubleBuffered(false);
349 doTest(reqGLCaps, new GearsES2(1));
350 }
351
352 @Test
353 public void testES2OffScreenFBODblBuf() throws InterruptedException {
354 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
355 if(null == reqGLCaps) return;
356 reqGLCaps.setOnscreen(false);
357 reqGLCaps.setFBO(true);
358 doTest(reqGLCaps, new GearsES2(1));
359 }
360
361 @Test
362 public void testES2OffScreenPbufferDblBuf() throws InterruptedException {
363 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
364 if(null == reqGLCaps) return;
365 reqGLCaps.setOnscreen(false);
366 reqGLCaps.setPBuffer(true);
367 doTest(reqGLCaps, new GearsES2(1));
368 }
369
370 @Test
371 public void testES2OffScreenPbufferSglBuf() throws InterruptedException {
372 final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
373 if(null == reqGLCaps) return;
374 reqGLCaps.setOnscreen(false);
375 reqGLCaps.setPBuffer(true);
376 reqGLCaps.setDoubleBuffered(false);
377 doTest(reqGLCaps, new GearsES2(1));
378 }
379
380 /** Not implemented !
381 @Test
382 public void testES2OffScreenBitmapDblBuf() throws InterruptedException {
383 if(!checkProfile(GLProfile.GLES2)) {
384 return;
385 }
386 final GLCapabilities reqGLCaps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
387 reqGLCaps.setOnscreen(false);
388 reqGLCaps.setBitmap(true);
389 doTest(reqGLCaps, new GearsES2(1));
390 } */
391
392 public static void main(final String args[]) throws IOException {
393 org.junit.runner.JUnitCore.main(TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.class.getName());
394 }
395
396}
void setBitmap(final boolean enable)
Requesting offscreen bitmap mode.
void setOnscreen(final boolean onscreen)
Sets whether the surface shall be on- or offscreen.
static Window createWindow(final CapabilitiesImmutable caps)
Create a top level Window entity on the default Display and default Screen.
NEWT Window events are provided for notification purposes ONLY.
Fully functional GLAutoDrawable implementation utilizing already created GLDrawable and GLContext ins...
final void windowResizedOp(final int newWidth, final int newHeight)
Handling resize events from the windowing system.
final void windowDestroyNotifyOp()
Implementation to handle destroy notifications from the windowing system.
final void windowRepaintOp()
Default implementation to handle repaint events from the windowing system.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext....
Specifies a set of OpenGL capabilities.
void setPBuffer(final boolean enable)
Requesting offscreen pbuffer mode.
void setDoubleBuffered(final boolean enable)
Enables or disables double buffering.
void setFBO(final boolean enable)
Requesting offscreen FBO mode.
Abstraction for an OpenGL rendering context.
Definition: GLContext.java:74
abstract int makeCurrent()
Makes this GLContext current on the calling thread.
static final int CONTEXT_CURRENT
Indicates that the context was made current during the last call to makeCurrent, value {@value}.
Definition: GLContext.java:114
abstract void release()
Releases control of this GLContext from the current thread.
static final int CONTEXT_CURRENT_NEW
Indicates that a newly-created context was made current during the last call to makeCurrent,...
Definition: GLContext.java:116
final String getGLVersion()
Returns a valid OpenGL version string, ie
Definition: GLContext.java:769
abstract AbstractGraphicsDevice getDefaultDevice()
Retrieve the default device connection, unit ID and unique ID name.
abstract GLDrawable createGLDrawable(NativeSurface target)
Returns an unrealized GLDrawable according to it's chosen GLCapabilitiesImmutable,...
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 StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, final boolean withCapabilitiesInfo)
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 getSurfaceWidth()
Returns the width of the client area excluding insets (window decorations) in pixel units.
AbstractGraphicsConfiguration getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window.
int[] convertToPixelUnits(final int[] windowUnitsAndResult)
Converts the given window units into pixel units in place.
int getSurfaceHeight()
Returns the height of the client area excluding insets (window decorations) in pixel units.
Specifying NEWT's Window functionality:
Definition: Window.java:115
void addWindowListener(WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
void setWindowDestroyNotifyAction(Runnable r)
Set a custom action handling destruction issued by a toolkit triggered window destroy replacing the d...
void setSize(int width, int height)
Sets the size of the window's client area in window units, excluding decorations.
void setVisible(boolean visible)
Calls setVisible(true, visible), i.e.
void destroy()
Destroys this window incl.releasing all related resources.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
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...
int getSurfaceWidth()
Returns the width of this GLDrawable's surface client area in pixel units.
boolean isRealized()
Returns true if this drawable is realized, otherwise false.
NativeSurface getNativeSurface()
Returns the associated NativeSurface of this NativeSurfaceHolder.
void setRealized(boolean realized)
Indicates to GLDrawable implementations whether the underlying surface has been created and can be dr...
int getSurfaceHeight()
Returns the height of this GLDrawable's surface client area in pixel units.
GLContext createContext(GLContext shareWith)
Creates a new context for drawing to this drawable that will optionally share buffer objects,...
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.