29package com.jogamp.opengl.test.junit.jogl.acore;
31import com.jogamp.newt.opengl.GLWindow;
32import com.jogamp.opengl.GLExtensions;
33import com.jogamp.opengl.test.junit.util.UITestCase;
35import com.jogamp.opengl.GL;
36import com.jogamp.opengl.GL2ES2;
37import com.jogamp.opengl.GL2ES3;
38import com.jogamp.opengl.GL2GL3;
39import com.jogamp.opengl.GLAutoDrawable;
40import com.jogamp.opengl.GLCapabilities;
41import com.jogamp.opengl.GLEventListener;
42import com.jogamp.opengl.GLProfile;
44import org.junit.Assert;
45import org.junit.BeforeClass;
46import org.junit.AfterClass;
48import org.junit.FixMethodOrder;
49import org.junit.runners.MethodSorters;
63@FixMethodOrder(MethodSorters.NAME_ASCENDING)
65 static int width, height;
81 System.err.println(
"GL UnitTester");
92 System.err.println(
" - pre GL-Error 0x"+Integer.toHexString(_glerr));
94 final int[] val =
new int[1];
100 System.out.println(
" - GL_MAX_TEXTURE_SIZE: " + val[0]);
102 System.err.println(
" - GL-Error 0x"+Integer.toHexString(glerr[i]));
107 System.out.println(
" - GL_ACTIVE_TEXTURE: " + val[0]);
109 System.err.println(
" - GL-Error 0x"+Integer.toHexString(glerr[i]));
115 System.out.println(
" - GL_MAX_TEXTURE_IMAGE_UNITS: " + val[0]);
117 System.err.println(
" - GL-Error 0x"+Integer.toHexString(glerr[i]));
124 System.out.println(
" - GL_MAX_COLOR_ATTACHMENTS: " + val[0]);
126 System.err.println(
" - GL-Error 0x"+Integer.toHexString(glerr[i]));
133 System.out.println(
" - GL_MAX_SAMPLES: " + val[0]);
135 System.err.println(
" - GL-Error 0x"+Integer.toHexString(glerr[i]));
141 for(
int j=0; j<i; j++) {
143 case 0: res +=
"GL_MAX_TEXTURE_SIZE";
break;
144 case 1: res +=
"GL_ACTIVE_TEXTURE";
break;
145 case 2: res +=
"GL_MAX_TEXTURE_IMAGE_UNITS";
break;
146 case 3: res +=
"GL_MAX_COLOR_ATTACHMENTS";
break;
147 case 4: res +=
"GL_MAX_SAMPLES";
break;
149 if(GL.GL_NO_ERROR == glerr[j]) {
156 Assert.assertTrue(res, ok);
160 public void dispose(
final GLAutoDrawable drawable) {
164 public void display(
final GLAutoDrawable drawable) {
168 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) {
174 Assert.assertNotNull(glWindow);
175 glWindow.
setTitle(getSimpleTestName(
"."));
177 final UnitTester demo =
new UnitTester();
181 glWindow.
setSize(width, height);
223 public static void main(
final String args[]) {
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void setTitle(final String title)
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Specifies a set of OpenGL capabilities.
final GLRendererQuirks getRendererQuirks()
Returns the instance of GLRendererQuirks, allowing one to determine workarounds.
final String getGLVersion()
Returns a valid OpenGL version string, ie
Class holding OpenGL extension strings, commonly used by JOGL's implementation.
static final String NV_fbo_color_attachments
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 GL3
The desktop OpenGL core profile 3.x, with x >= 1.
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.
static final String GL2
The desktop OpenGL profile 1.x up to 3.0.
static final String GLES1
The embedded OpenGL profile ES 1.x, with x >= 0.
static final String GL4
The desktop OpenGL core profile 4.x, with x >= 0.
final StringBuilder toString(StringBuilder sb)
Some GL state values are broken w/ Mesa 9.0 w/ multiple different context.
static void releaseClass()
void runTestGL(final GLCapabilities caps)
static void main(final String args[])
static final int GL_MAX_COLOR_ATTACHMENTS
GL_ES_VERSION_3_0, GL_ARB_framebuffer_object, GL_VERSION_3_0, GL_EXT_draw_buffers,...
static final int GL_MAX_TEXTURE_IMAGE_UNITS
GL_ES_VERSION_2_0, GL_VERSION_2_0, GL_NV_fragment_program, GL_ARB_fragment_program Alias for: GL_MAX_...
static final int GL_SHADING_LANGUAGE_VERSION
GL_ES_VERSION_2_0, GL_VERSION_2_0, GL_ARB_shading_language_100 Alias for: GL_SHADING_LANGUAGE_VERSION...
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
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.
boolean hasGLSL()
Indicates whether this GL object supports GLSL.
boolean hasBasicFBOSupport()
Returns true if basic FBO support is available, otherwise false.
GLProfile getGLProfile()
Returns the GLProfile associated with this GL object.
boolean isGL2ES2()
Indicates whether this GL object conforms to a GL2ES2 compatible profile.
boolean isExtensionAvailable(String glExtensionName)
Returns true if the specified OpenGL extension can be used successfully through this GL instance give...
GLContext getContext()
Returns the GLContext associated which this GL object.
boolean isFunctionAvailable(String glFunctionName)
Returns true if the specified OpenGL core- or extension-function can be used successfully through thi...
boolean hasFullFBOSupport()
Returns true if full FBO support is available, otherwise false.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.
void glGetIntegerv(int pname, IntBuffer data)
Entry point to C language function: void {@native glGetIntegerv}(GLenum pname, GLint * data) Part ...
static final int GL_VERSION
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_VERSION" with express...
static final int GL_NO_ERROR
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_NO_ERROR" with expres...
int glGetError()
Entry point to C language function: GLenum {@native glGetError}() Part of GL_ES_VERSION_2_0,...
static final int GL_ACTIVE_TEXTURE
GL_ES_VERSION_2_0, GL_VERSION_1_3, GL_VERSION_ES_1_0, GL_ARB_multitexture Alias for: GL_ACTIVE_TEXTUR...
String glGetString(int name)
Entry point to C language function: const GLubyte * {@native glGetString}(GLenum name) Part of GL_...
static final int GL_RENDERER
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_RENDERER" with expres...
static final int GL_VENDOR
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_VENDOR" with expressi...
static final int GL_MAX_TEXTURE_SIZE
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_MAX_TEXTURE_SIZE" wit...
static final int GL_MAX_SAMPLES
GL_ES_VERSION_3_0, GL_ARB_framebuffer_object, GL_VERSION_3_0, GL_NV_framebuffer_multisample,...