Skip to main content
gamedev.net
🔒 Locked

Debugging tips?

Started by void0 5 replies 900+ views
Original Post
void0
void0
It would be very useful to have #define's for all functions, so you could trace where the error originated. Just doing glGetError() here and there isn't very practical. How do you debug OpenGL errors effectively?
dhm
dhm
Hi,

Variety of methods. There are lots of articles on debugging all over the net - Gamedev.net have some useful ones for beginners. Use the article/column search facility to find them.

Most errors I have found, I have been using the OpenGL API in the incorrect way (incorrect parameters, misunderstanding parameters, invalid function call order etc.). I can recommend gDEBugger from Graphic Remedy for these kinds of errors.

Your idea of #define's sounds interesting. Although pratically it might be a complete pain to maintain and debug in itself.

Good luck.

Cheers,
dhm
void0
void0
Thanks for the suggestions. Though, I should mention that I'm using Gentoo GNU/Linux so glIntercept and gDEBugger are not very helpful.
CrazyCdn
CrazyCdn
The source code for glIntercept is free. You can see how they intercept them and write your own mini program for linux?
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin
hplus0603
hplus0603
Add assert(!glGetError()) after every call to GL. This will make your program stop as soon as you call something wrong. The cost in debug mode is minimal, and the cost in an optimized build is 0 because the assert is taken out.

You should program a macro or hotkey to insert this assert, so you don't have to type it a lot.
enum Bool { True, False, FileNotFound };
nitm
nitm
BuGLe is the alternative to GLIntercept for linux, there isn't ebuild for gentoo but it compiles fine with the configure script :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.