Hi,
The following sample code works:
Display.create(); // create context with LWJGL
if (GLContext.getCapabilities().GL_AMD_debug_output)
{
AMDDebugOutput.glDebugMessageCallbackAMD(new AMDDebugOutputCallback(
new AMDDebugOutputCallback.Handler()
{
public void handleMessage(final int id, final int category, final int severity, final String message)
{
[...]
}
}));
}
In my situation, I am not getting the GL context from Display.create().
The context is created and made active by another native library:
// The following call calls wglMakeCurrent().
SomeObject.someNativeMethodThatCallsWglMakeCurrent();
GLContext.useContext(someGlobalObject);
/*
At this point I *can* use LWJGL functions like glBindBuffer and so on.
However, AMDDebugOutput.glDebugMessageCallbackAMD() raises the following exception:
java.lang.IllegalStateException: No context is current.
at org.lwjgl.opengl.CallbackUtil.registerContextCallback(CallbackUtil.java:91)
at org.lwjgl.opengl.CallbackUtil.registerContextCallbackAMD(CallbackUtil.java:154)
at org.lwjgl.opengl.AMDDebugOutput.glDebugMessageCallbackAMD(AMDDebugOutput.java:80)
Why ?
*/
Any idea? I'm stuck.
Thanks,
Fred
Try the next nightly build, it should be fixed now.
It works fine with LWJGL 2.8.2.
Thanks.