ARB Debug Output and other extensions

Started by krazy0, November 03, 2013, 10:03:41

Previous topic - Next topic

krazy0

I've been having some difficulty getting some output using the ARB_Debug_Output extension. Stack Overflow question

I've noticed the extension seems to be implemented by the ARBDebugOutput class and the ARBDebugOutputCallback class. I have not found much documentation about either of these and can't seem to get them to work.

Is this in general how lwjgl implements extensions (with specific classes for each extension)? or can you use an extension in a similar way to programming with C/C++.

Any help with this would be greatly appreciated.

spasi

You need to pass the ARBDebugOutputCallback instance to glDebugMessageCallbackARB, like so:

glDebugMessageCallbackARB(new ARBDebugOutputCallback());


This will use the default implementation that simply prints the message on the standard error stream. If you need to customize this, you can do:

ARBDebugOutput.glDebugMessageCallbackARB(new ARBDebugOutputCallback(new Handler() {
	public void handleMessage(int source, int type, int id, int severity, String message) {
		// your code here
	}
}));