So, is this correct for creating a debug context? and also how do i confirm that i have/can create a debug context??

is there any command that i can issue to check if debug context is indeed created ??

And if the above is correct, then can you point me at how i can get the address of the debug functions?

Aleksandar

08-20-2012, 09:09 AM

Looks OK.

The only purpose of debugging context is to enable debugging. So if you can call debug_output functions you certainly have a debug context.
Is glrc context is valid? Try to debug and take a look at the value of that handle.

vamsee

08-20-2012, 09:12 AM

yeah the handle is valid, i can draw primitives and all ....

but, i cant make any debug functions to work!

Alfonse Reinheart

08-20-2012, 09:19 AM

how do i confirm that i have/can create a debug context?

If you have GL 4.3, you can query `GL_CONTEXT_FLAGS` and test the result against `GL_CONTEXT_FLAG_DEBUG_BIT`. But if you don't, you can't.

However, if you have reasonably up-to-date drivers, creating a debug context will cause NVIDIA's drivers to spam error messages to standard out. So if you don't get that spam, you probably didn't do it right.

vamsee

08-20-2012, 09:35 AM

So for earlier versions of openGL there is no way of confirming that debug context is enabled??
thats sad!

im on the latest drivers for my card(not the beta drivers though). I still dont see any error messages.
but im working on my laptop with a mobile graphic card, so may be that could be a problem.

Can any one share with me any code snippet that works on your machine for setting a debug context?

Alfonse Reinheart

08-20-2012, 01:07 PM

So for earlier versions of openGL there is no way of confirming that debug context is enabled??
thats sad!

Why? Until KHR_debug (the core extension that introduced debug output), there was no behavior in OpenGL that changed based on it. An implementation does not have to offer ARB_debug_output if you use a debug context. An implementation does not have to remove ARB_debug_output if you don't ask for a debug context.

So being able to check for a debug context never mattered before KHR_debug. Which is why it is KHR_debug that adds the `GL_CONTEXT_FLAG_DEBUG_BIT`.

vamsee

08-21-2012, 10:38 AM

sorry but i dont understand where did KHR_debug came in between ARB_debug, arent they like different implementations or something??
(i also checked for the KHR_debug, that also is shown as missing in glew output)

may be im going off topic here, so coming back to what i was asking for

what is the solution to this problem ? (how do i make sure my current drivers have arb_debug_output supported?)

Alfonse Reinheart

08-21-2012, 11:00 AM

how do i make sure my current drivers have arb_debug_output supported?

You cannot.

You can set the debug flag in your context creation logic. But if the implementation doesn't want to expose ARB_debug_output, that is its right. Just like you can't force support for ARB_tessellation_shader or any other extension.

That being said, the easiest way to test this is really simple: use someone else's context creation code. Download FreeGLUT and make a simple application with it, using the GLUT_DEBUG flag. If that gets you ARB_debug_output, then clearly the issue is with your context creation code. If it doesn't, then your implementation doesn't support ARB_debug_output.

vamsee

08-21-2012, 11:25 AM

Thanks for your inputs, luckily i dinn have to go through the freeGlut route, i doubt it would have given any different result. Because, i finally solved it!!!

As it turns out my code was absolutely fine, just that the drivers did not have the implementation for arb_debug_output.(my latest drivers dont have the extension!, But the desktop version do have them!)
i've used the latest desktop drivers (used the modded inf file to get it installed on my laptop)

then tested my app again, and VOILA it works like a charm! ............. finally!