Creating a Debug Context

To get the most from OpenGL’s debugging facilities, it is necessary to create a debug context, which implies that you need control over the flags and parameters used to create the context. Context creation is a platform-specific task that is often handled by a wrapper layer such as GLUT. Modern implementations of GLUT (such as FreeGLUT, which we use in many of this book’s samples) include the function glutInitContextFlags(). This function takes a number of flags that can be used to control how contexts subsequently created behave. One of these flags is GLUT_DEBUG, which will enable a debug context. Many other platform abstraction layers have similar mechanisms. If you are not using an abstraction layer, then you will ...

Get OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.3, Eighth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.