Difference between revisions of "Portal:OpenGL Concepts/Debugging"

From OpenGL Wiki
Jump to navigation Jump to search
(Basic debugging page.)
 
m (Small clarification)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
'''Debugging''' an OpenGL application can be difficult. But OpenGL does provide ways to make debugging more reasonable.
 
'''Debugging''' an OpenGL application can be difficult. But OpenGL does provide ways to make debugging more reasonable.
  
OpenGL requires its functions to [[Error Checking|check their parameters for mistakes or inconsistencies]], and emit [[OpenGL Error Code|errors]] when this occurs. Many other aspects of function calls are checked, to make sure that the current context state matches with what the system expects. If it does not, other errors are emitted.
+
OpenGL requires its functions to [[OpenGL Error|check their parameters for mistakes or inconsistencies]], and emit [[OpenGL Error Codes|errors]] should these occur. If an error occurs, in the vast majority of cases, the function emitting the error will have no effect.
  
Because [[Error Checking|error checking]] is a very manual process, many OpenGL implementations provide access to [[Debug Output]]. This functionality is a powerful mechanism for testing against these kinds of errors.
+
Because [[Error Checking|error checking]] is a very manual process, many OpenGL implementations provide access to [[Debug Output]]. This functionality is a powerful mechanism for handling testing these kinds of errors without being explicit about it. There are also a number of [[Debugging Tool]]s available to help track down OpenGL errors and other issues.
  
These mechanisms only test malformed use of the API; there are many things that can go wrong which are not checked for. For these, there are a number of [[Debugging Tool]]s available to help track down various issues.
+
The OpenGL error mechanism does not test all possible incorrect uses of the API; this is mainly for performance reasons. Most untested mistakes result in improper rendering and must be manually found, though debugging tools can help in these cases too.

Latest revision as of 15:36, 1 December 2014

Debugging an OpenGL application can be difficult. But OpenGL does provide ways to make debugging more reasonable.

OpenGL requires its functions to check their parameters for mistakes or inconsistencies, and emit errors should these occur. If an error occurs, in the vast majority of cases, the function emitting the error will have no effect.

Because error checking is a very manual process, many OpenGL implementations provide access to Debug Output. This functionality is a powerful mechanism for handling testing these kinds of errors without being explicit about it. There are also a number of Debugging Tools available to help track down OpenGL errors and other issues.

The OpenGL error mechanism does not test all possible incorrect uses of the API; this is mainly for performance reasons. Most untested mistakes result in improper rendering and must be manually found, though debugging tools can help in these cases too.