29package com.jogamp.opengl.test.junit.jogl.acore;
31import java.io.IOException;
33import com.jogamp.nativewindow.CapabilitiesImmutable;
34import com.jogamp.opengl.GLCapabilities;
35import com.jogamp.opengl.GLCapabilitiesImmutable;
36import com.jogamp.opengl.GLContext;
37import com.jogamp.opengl.GLDrawableFactory;
38import com.jogamp.opengl.GLEventListener;
39import com.jogamp.opengl.GLOffscreenAutoDrawable;
40import com.jogamp.opengl.GLProfile;
42import jogamp.opengl.GLGraphicsConfigurationUtil;
44import org.junit.Assert;
46import org.junit.FixMethodOrder;
47import org.junit.runners.MethodSorters;
49import com.jogamp.opengl.JoglVersion;
50import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
51import com.jogamp.opengl.test.junit.util.GLTestUtil;
52import com.jogamp.opengl.test.junit.util.UITestCase;
61@FixMethodOrder(MethodSorters.NAME_ASCENDING)
63 static final int widthStep = 800/4;
64 static final int heightStep = 600/4;
65 volatile int szStep = 2;
69 System.err.println(
"Profile "+profile+
" n/a");
76 System.out.println(
"Requested GL Caps: "+reqGLCaps);
78 final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory,
null);
79 System.out.println(
"Expected GL Caps: "+expGLCaps);
87 Assert.assertNotNull(glad);
88 System.out.println(
"Drawable Pre-GL(0): "+glad.getClass().getName()+
", "+glad.
getNativeSurface().getClass().getName());
93 System.out.println(
"Drawable Caps Pre_GL : "+chosenCaps);
94 Assert.assertNotNull(chosenCaps);
104 System.out.println(
"Chosen GL Caps(1): "+chosenGLCaps);
107 Assert.assertNotNull(chosenGLCaps);
110 Assert.assertTrue(chosenGLCaps.
getRedBits()>4);
113 Assert.assertEquals(expGLCaps.
isFBO(), chosenGLCaps.
isFBO());
154 System.out.println(
"Fin Drawable: "+glad);
160 if(
null == reqGLCaps)
return;
168 if(
null == reqGLCaps)
return;
177 if(
null == reqGLCaps)
return;
187 if(
null == reqGLCaps)
return;
197 if(
null == reqGLCaps)
return;
208 if(
null == reqGLCaps)
return;
220 if(
null == reqGLCaps)
return;
229 if(
null == reqGLCaps)
return;
240 if(
null == reqGLCaps)
return;
251 if(
null == reqGLCaps)
return;
263 if(
null == reqGLCaps)
return;
329 public static void main(
final String args[])
throws IOException {
void setOnscreen(final boolean onscreen)
Sets whether the surface shall be on- or offscreen.
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.
final String getGLVersion()
Returns a valid OpenGL version string, ie
abstract GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps, GLCapabilitiesChooser chooser, int width, int height)
Creates a realized GLOffscreenAutoDrawable incl it's offscreen NativeSurface with the given capabilit...
static GLDrawableFactory getFactory(final GLProfile glProfile)
Returns the sole GLDrawableFactory instance.
Specifies the the OpenGL profile.
static boolean isAvailable(final AbstractGraphicsDevice device, final String profile)
Returns the availability of a profile on a device.
static final String GLES2
The embedded OpenGL profile ES 2.x, with x >= 0.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
Toolkit agnostic GLOffscreenAutoDrawable tests using the factory model.
void testES2OffScreenPbufferDblBufStencilMSAA()
void testES2OffScreenPbufferDblBuf()
static void main(final String args[])
NOT Implemented: Might be reduced to !double-buff @Test public void testES2OffScreenBitmapDblBuf() th...
void testES2OffScreenFBODblBuf()
void testES2OffScreenFBODblBufMSAA()
void testES2OffScreenPbufferSglBuf()
void testES2OffScreenPbufferDblBufStencil()
void testES2OffScreenPbufferDblBufMSAA()
void testES2OffScreenAutoDblBuf()
void testES2OffScreenFBODblBufStencilMSAA()
void testES2OffScreenFBODblBufStencil()
void testES2OffScreenFBOSglBuf()
static boolean waitForSize(final GLDrawable drawable, final int width, final int height, 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.
AbstractGraphicsConfiguration getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
GLContext getContext()
Returns the context associated with this drawable.
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.
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.
int getSurfaceHeight()
Returns the height of this GLDrawable's surface client area in pixel units.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.
Platform-independent GLAutoDrawable specialization, exposing offscreen functionality.
void setSurfaceSize(int newWidth, int newHeight)
Resize this GLAutoDrawable's surface.