29package com.jogamp.opengl.test.junit.jogl.acore;
31import java.io.IOException;
33import com.jogamp.opengl.GL2ES2;
34import com.jogamp.opengl.GLAutoDrawable;
35import com.jogamp.opengl.GLCapabilities;
36import com.jogamp.opengl.GLContext;
37import com.jogamp.opengl.GLDebugListener;
38import com.jogamp.opengl.GLDebugMessage;
39import com.jogamp.opengl.GLProfile;
40import com.jogamp.opengl.GLRunnable;
42import org.junit.Assert;
44import org.junit.FixMethodOrder;
45import org.junit.runners.MethodSorters;
47import com.jogamp.newt.opengl.GLWindow;
48import com.jogamp.opengl.test.junit.util.UITestCase;
50@FixMethodOrder(MethodSorters.NAME_ASCENDING)
53 static String dbgTstMsg0 =
"Hello World";
54 static int dbgTstId0 = 42;
56 static GLProfile getGLProfile(
final String profile) {
58 System.err.println(
"Profile "+profile+
" n/a");
70 Assert.assertNotNull(window);
81 void destroyWindow(
final GLWindow window) {
86 void testX1GLDebugEnableDisable(
final GLProfile glp,
final boolean enable,
final String dbgTstMsg,
final int dbgTstId)
throws InterruptedException {
87 final GLWindow window = createWindow(glp, enable);
94 System.err.println(
"glDebug extension: "+glDebugExt);
97 System.err.println(
"context version: "+ctx.
getGLVersion());
110 Assert.assertEquals(
true, myGLDebugListener.received());
113 destroyWindow(window);
122 testX1GLDebugEnableDisable(glp,
false,
null, -1);
131 testX1GLDebugEnableDisable(glp,
true, dbgTstMsg0, dbgTstId0);
140 testX1GLDebugEnableDisable(glp,
false,
null, -1);
149 testX1GLDebugEnableDisable(glp,
true, dbgTstMsg0, dbgTstId0);
152 void testX3GLDebugError(
final GLProfile glp)
throws InterruptedException {
153 final GLWindow window = createWindow(glp,
true);
155 final MyGLDebugListener myGLDebugListener =
new MyGLDebugListener(
169 Assert.assertEquals(
true, myGLDebugListener.received());
172 destroyWindow(window);
181 testX3GLDebugError(glp);
190 testX3GLDebugError(glp);
193 public static void main(
final String args[])
throws IOException {
195 org.junit.runner.JUnitCore.
main(tstname);
205 boolean received =
false;
208 this.recSource = recSource;
209 this.recType = recType;
210 this.recSeverity = recSeverity;
218 this.recSeverity = -1;
219 this.recMsg = recMsg;
226 System.err.println(
"XXX: "+event);
227 if(
null != recMsg && recMsg.equals(event.
getDbgMsg()) && recId == event.
getDbgId()) {
229 }
else if(0 <= recSource && recSource == event.
getDbgSource() &&
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
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.
Abstraction for an OpenGL rendering context.
final boolean isCreated()
Indicates whether the underlying native OpenGL context has been created.
abstract boolean isGLDebugMessageEnabled()
abstract boolean isGLDebugSynchronous()
abstract void addGLDebugListener(GLDebugListener listener)
Add GLDebugListener.
abstract String getGLDebugMessageExtension()
static final int CTX_OPTION_DEBUG
ARB_create_context related: flag debug.
final String getGLVersion()
Returns a valid OpenGL version string, ie
abstract void glDebugMessageInsert(int source, int type, int id, int severity, String buf)
Generic entry for GL2GL3#glDebugMessageInsert(int, int, int, int, int, String) and GL2GL3#glDebugMess...
OpenGL debug message generated by the driver and delivered via GLDebugListener.
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 final String GL2GL3
The intersection of the desktop GL3 and GL2 profile.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
MyGLDebugListener(final int recSource, final int recType, final int recSeverity)
MyGLDebugListener(final String recMsg, final int recId)
void messageSent(final GLDebugMessage event)
Handle GLDebugMessage message sent from native GL implementation.
void test01GL2GL3DebugDisabled()
static void main(final String args[])
void test02GL2GL3DebugEnabled()
void test12GLES2DebugEnabled()
void test13GLES2DebugError()
void test11GLES2DebugDisabled()
void test03GL2GL3DebugError()
static final int GL_DEBUG_SOURCE_APPLICATION
GL_KHR_debug, GL_ES_VERSION_3_2, GL_VERSION_4_3, GL_KHR_debug, GL_ARB_debug_output Alias for: GL_DEBU...
static final int GL_DEBUG_TYPE_OTHER
GL_KHR_debug, GL_ES_VERSION_3_2, GL_VERSION_4_3, GL_ARB_debug_output, GL_KHR_debug Alias for: GL_DEBU...
static final int GL_DEBUG_TYPE_ERROR
GL_KHR_debug, GL_ES_VERSION_3_2, GL_VERSION_4_3, GL_ARB_debug_output, GL_KHR_debug Alias for: GL_DEBU...
static final int GL_DEBUG_SEVERITY_MEDIUM
GL_KHR_debug, GL_ES_VERSION_3_2, GL_VERSION_4_3, GL_KHR_debug, GL_ARB_debug_output,...
static final int GL_DEBUG_SEVERITY_HIGH
GL_KHR_debug, GL_ES_VERSION_3_2, GL_VERSION_4_3, GL_ARB_debug_output, GL_KHR_debug,...
static final int GL_DEBUG_SOURCE_API
GL_KHR_debug, GL_ES_VERSION_3_2, GL_VERSION_4_3, GL_ARB_debug_output, GL_KHR_debug Alias for: GL_DEBU...
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
void setContextCreationFlags(int flags)
boolean invoke(boolean wait, GLRunnable glRunnable)
Enqueues a one-shot GLRunnable, which will be executed within the next display() call after all regis...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
GLContext getContext()
Returns the context associated with this drawable.
Listener for GLDebugMessages.
void glBindFramebuffer(int target, int framebuffer)
Entry point to C language function: void {@native glBindFramebuffer}(GLenum target,...