Top Description Inners Fields Constructors Methods
jogamp.opengl

public Class GLDebugMessageHandler

extends Object
Class Inheritance
Imports
java.security.AccessController, .PrivilegedAction, java.util.ArrayList, com.jogamp.nativewindow.NativeWindowException, com.jogamp.opengl.GL2ES2, .GLDebugListener, .GLDebugMessage, .GLException, .GLExtensions, jogamp.common.os.PlatformPropsImpl, com.jogamp.common.ExceptionUtils, com.jogamp.common.os.Platform, com.jogamp.gluegen.runtime.ProcAddressTable

The GLDebugMessageHandler, handling GL_ARB_debug_output or GL_AMD_debug_output debug messages.

An instance must be bound to the current thread's GLContext to achieve thread safety.

A native callback function is registered at enable(true), which forwards received messages to the added GLDebugListener directly. Hence the GLDebugListener#messageSent(GLDebugMessage) implementation shall return as fast as possible.

In case no GL_ARB_debug_output is available, but GL_AMD_debug_output, the messages are translated to ARB GLDebugMessage, using GLDebugMessage#translateAMDEvent(com.jogamp.opengl.GLContext, long, int, int, int, String).

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final GLContextImpl
private static final boolean
private static final int
private static final int
private static final int
private boolean
private String
private String
private int
private long
private long
private final ListenerSyncedImplStub<GLDebugListener>
private boolean

Constructor Summary

AccessConstructor and Description
public
GLDebugMessageHandler(final GLContextImpl
the associated GLContext
ctx
)

Method Summary

Modifier and TypeMethod and Description
public final void
addListener(final GLDebugListener listener)

public final void
addListener(final int index, final GLDebugListener listener)

public final void
enable(final boolean enable)

pack-priv final void
enableImpl(final boolean enable)

private final long
getAddressFor(final ProcAddressTable table, final String functionName)

public final String

Returns:

The extension implementing the GLDebugMessage feature, either GL_ARB_debug_output or GL_AMD_debug_output. If unavailable null is returned.
getExtension
()

protected final void
glDebugMessageAMD(final int id, final int category, final int severity, final String msg)

protected final void
glDebugMessageARB(final int source, final int type, final int id, final int severity, final String msg)

public void
init(final boolean enable)

public void
init()

private static native boolean
public final boolean
public final boolean
public final boolean
public final boolean
public final boolean
public final boolean
public final boolean
public final int
private native long
register0(long glDebugMessageCallbackProcAddress, int extType)

public final void
private final void
public final void
setSynchronous(final boolean synchronous)

private final void
private native void
unregister0(long glDebugMessageCallbackProcAddress, long handle)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ctxback to summary
private final GLContextImpl ctx
DEBUGback to summary
private static final boolean DEBUG
EXT_AMDback to summary
private static final int EXT_AMD
EXT_ARBback to summary
private static final int EXT_ARB
EXT_KHRback to summary
private static final int EXT_KHR
extAvailableback to summary
private boolean extAvailable
extNameback to summary
private String extName
extSuffixback to summary
private String extSuffix
extTypeback to summary
private int extType
glDebugMessageCallbackProcAddressback to summary
private long glDebugMessageCallbackProcAddress
handleback to summary
private long handle
listenerImplback to summary
private final ListenerSyncedImplStub<GLDebugListener> listenerImpl
synchronousback to summary
private boolean synchronous

Constructor Detail

GLDebugMessageHandlerback to summary
public GLDebugMessageHandler(final GLContextImpl ctx)
Parameters
ctx:GLContextImpl

the associated GLContext

Method Detail

addListenerback to summary
public final void addListener(final GLDebugListener listener)
addListenerback to summary
public final void addListener(final int index, final GLDebugListener listener)
enableback to summary
public final void enable(final boolean enable) throws GLException
See Also
com.jogamp.opengl.GLContext#enableGLDebugMessage(boolean)
enableImplback to summary
pack-priv final void enableImpl(final boolean enable) throws GLException
getAddressForback to summary
private final long getAddressFor(final ProcAddressTable table, final String functionName)
getExtensionback to summary
public final String getExtension()
Returns:String

The extension implementing the GLDebugMessage feature, either GL_ARB_debug_output or GL_AMD_debug_output. If unavailable null is returned.

glDebugMessageAMDback to summary
protected final void glDebugMessageAMD(final int id, final int category, final int severity, final String msg)
glDebugMessageARBback to summary
protected final void glDebugMessageARB(final int source, final int type, final int id, final int severity, final String msg)
initback to summary
public void init(final boolean enable)
initback to summary
public void init()
initIDs0back to summary
private static native boolean initIDs0()
isAvailableback to summary
public final boolean isAvailable()
isEnabledback to summary
public final boolean isEnabled()
isExtensionAMDback to summary
public final boolean isExtensionAMD()
isExtensionARBback to summary
public final boolean isExtensionARB()
isExtensionKHRback to summary
public final boolean isExtensionKHR()
isExtensionKHRARBback to summary
public final boolean isExtensionKHRARB()
isSynchronousback to summary
public final boolean isSynchronous()
See Also
com.jogamp.opengl.GLContext#isGLDebugSynchronous()
listenerSizeback to summary
public final int listenerSize()
register0back to summary
private native long register0(long glDebugMessageCallbackProcAddress, int extType)
removeListenerback to summary
public final void removeListener(final GLDebugListener listener)
sendMessageback to summary
private final void sendMessage(final GLDebugMessage msg)
setSynchronousback to summary
public final void setSynchronous(final boolean synchronous)
See Also
com.jogamp.opengl.GLContext#setGLDebugSynchronous(boolean)
setSynchronousImplback to summary
private final void setSynchronousImpl()
unregister0back to summary
private native void unregister0(long glDebugMessageCallbackProcAddress, long handle)
jogamp.opengl back to summary

public Class GLDebugMessageHandler.StdErrGLDebugListener

extends Object
implements GLDebugListener
Class Inheritance
All Implemented Interfaces
com.jogamp.opengl.GLDebugListener

Field Summary

Modifier and TypeField and Description
pack-priv boolean

Constructor Summary

AccessConstructor and Description
public
StdErrGLDebugListener(final boolean threadDump)

Method Summary

Modifier and TypeMethod and Description
public void
messageSent(final GLDebugMessage event)

Implements com.jogamp.opengl.GLDebugListener.messageSent.

Handle GLDebugMessage message sent from native GL implementation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

threadDumpback to summary
pack-priv boolean threadDump

Constructor Detail

StdErrGLDebugListenerback to summary
public StdErrGLDebugListener(final boolean threadDump)

Method Detail

messageSentback to summary
public void messageSent(final GLDebugMessage event)

Implements com.jogamp.opengl.GLDebugListener.messageSent.

Doc from com.jogamp.opengl.GLDebugListener.messageSent.

Handle GLDebugMessage message sent from native GL implementation.

Since this method is invoked directly by the GL implementation, it shall return as fast as possible.

Annotations
@Override