Section B.2. Errors


B.2. Errors

As a general rule, don't place calls to glGetError() in production code. OpenGL errors usually are an indication of a bug in your application that should be resolved during development. Furthermore, calls to glGetError(), although relatively inexpensive, have a nonzero cost, so they shouldn't appear in production code for performance reasons.

Finally, OpenGL error semantics are subject to change in future revisions of OpenGL. Although The OpenGL Graphics System and extension specifications define all the conditions that cause an error, an action that causes an error today might not cause an error in the future. If your application depends on certain errors occurring under certain circumstances, your code will break if those errors go away in a future version of OpenGL.

In summary, you should test for errors, absolutely; see appendix D, "Troubleshooting and Debugging." But you should not write code that depends on an error for the application to operate correctly.




OpenGL Distilled
OpenGL Distilled
ISBN: 0321336798
EAN: 2147483647
Year: 2007
Pages: 123
Authors: Paul Martz

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net