I'm struggling a bit with glDebugMessageCallback in lwjgl v.3.0.0a. Most examples use ARBDebugOutputCallback and ARBDebugOutputCallback.Handler, but they don't seem to be a part of the library anymore. The message argument is passed as a long (pointer), how do I get the string representation of the message?
You have to use org.lwjgl.system.MemoryUtil (https://github.com/LWJGL/lwjgl3/blob/master/modules/core/src/main/java/org/lwjgl/system/MemoryUtil.java) methods (or roll your own):
// creates a ByteBuffer starting at the 'message' pointer, with capacity equal to 'length', then decodes it as a UTF8 string
String msg = memDecodeUTF8(memByteBuffer(message, length));
See this (https://github.com/LWJGL/lwjgl3/blob/master/modules/core/src/main/java/org/lwjgl/opengl/GLContext.java#L155) and the code that follows for examples.
Thanks