29package com.jogamp.opengl.test.junit.jogl.acore;
31import java.io.IOException;
33import com.jogamp.nativewindow.AbstractGraphicsDevice;
34import com.jogamp.nativewindow.CapabilitiesImmutable;
35import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
36import com.jogamp.opengl.GLCapabilities;
37import com.jogamp.opengl.GLCapabilitiesImmutable;
38import com.jogamp.opengl.GLContext;
39import com.jogamp.opengl.GLDrawableFactory;
40import com.jogamp.opengl.GLEventListener;
41import com.jogamp.opengl.GLOffscreenAutoDrawable;
42import com.jogamp.opengl.GLProfile;
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.GLEventListenerCounter;
52import com.jogamp.opengl.test.junit.util.GLTestUtil;
53import com.jogamp.opengl.test.junit.util.UITestCase;
59@FixMethodOrder(MethodSorters.NAME_ASCENDING)
61 static final int widthStep = 800/4;
62 static final int heightStep = 600/4;
63 volatile int szStep = 2;
67 System.err.println(
"Profile "+profile+
" n/a");
76 System.err.println(
"Factory: "+factory.getClass().getName());
77 System.err.println(
"Requested GL Caps: "+reqGLCaps);
85 Assert.assertNotNull(glad);
90 Assert.assertNotNull(chosenCaps);
96 Assert.assertNotNull(chosenGLCaps);
97 System.err.println(
"Choosen GL Caps: "+chosenGLCaps);
121 System.err.println(
"Fin isEGL "+isEGL+
", "+adevice);
122 System.err.println(
"Fin "+glelc);
123 Assert.assertTrue(
"init count: "+glelc, glelc.
initCount > 0);
124 Assert.assertTrue(
"reshape count: "+glelc, glelc.
reshapeCount > 0);
125 Assert.assertTrue(
"display count: "+glelc, glelc.
displayCount > 0);
126 Assert.assertTrue(
"dispose count: "+glelc, glelc.
disposeCount > 0);
127 Assert.assertEquals(
"EGL/Desktop not matching: isEGL "+isEGL+
", "+adevice, isEGL, adevice instanceof
EGLGraphicsDevice);
145 if(
null == factory ) {
146 System.err.println(
"Mobile Factory n/a");
152 Assert.assertTrue(
"Not a GLES2 profile but "+glp, glp.
isGLES2());
153 Assert.assertTrue(
"Not a GL2ES2 profile but "+glp, glp.
isGL2ES2());
162 doTest(
true , factory, prodDevice, reqGLCaps, demo);
168 if(
null == factory ) {
169 System.err.println(
"Mobile Factory n/a");
175 Assert.assertTrue(
"Not a GL2GL3 profile but "+glp, glp.
isGL2GL3());
177 if(
null == glp || !glp.
isGL2ES2()) {
179 System.err.println(
"Not a GL2ES2 profile but "+glp);
187 doTest(
true , factory, prodDevice, reqGLCaps, demo);
193 if(
null == deskFactory ) {
194 System.err.println(
"Desktop Factory n/a");
200 Assert.assertTrue(
"Not a GLES2 profile but "+glp, glp.
isGLES2());
201 Assert.assertTrue(
"Not a GL2ES2 profile but "+glp, glp.
isGL2ES2());
207 if(
null == prodFactory ) {
208 System.err.println(
"Production Factory n/a");
215 doTest(
true , prodFactory, prodDevice, reqGLCaps, demo);
221 if(
null == factory ) {
222 System.err.println(
"Desktop Factory n/a");
228 Assert.assertTrue(
"Not a GL2GL3 profile but "+glp, glp.
isGL2GL3());
230 if(
null == glp || !glp.
isGL2ES2()) {
232 System.err.println(
"Not a GL2ES2 profile but "+glp);
240 doTest(
false , factory, prodDevice, reqGLCaps, demo);
243 public static void main(
final String args[])
throws IOException {
void setOnscreen(final boolean onscreen)
Sets whether the surface shall be on- or offscreen.
Encapsulates a graphics device on EGL platforms.
Specifies a set of OpenGL capabilities.
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...
abstract AbstractGraphicsDevice getDefaultDevice()
Retrieve the default device connection, unit ID and unique ID name.
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.
final boolean isGLES2()
Indicates whether this profile is capable of GLES2.
static final String GLES2
The embedded OpenGL profile ES 2.x, with x >= 0.
final boolean isGL2ES2()
Indicates whether this profile is capable of GL2ES2.
static final String GL2GL3
The intersection of the desktop GL3 and GL2 profile.
final boolean isGL2GL3()
Indicates whether this profile is capable of GL2GL3.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
static StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, final boolean withCapabilitiesInfo)
Testing producing GLContext instances of different GLProfiles using different AbstractGraphicsDevices...
static void main(final String args[])
void test00AvailableInfo()
void test11ES2OnDesktop()
GearsES2 setVerbose(final boolean v)
static boolean waitForSize(final GLDrawable drawable, final int width, final int height, final Runnable waitAction)
AbstractGraphicsScreen getScreen()
Return the screen this graphics configuration is valid for.
A interface describing a graphics device in a toolkit-independent manner.
AbstractGraphicsDevice getDevice()
Return the device this graphics configuration is valid for.
Specifies an immutable set of capabilities that a window's rendering context must support,...
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.
Specifies an immutable set of OpenGL capabilities.
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.