Pitfalls to Watch Out For
Sometimes the problem isn’t obvious: glGetError doesn’t return anything unusual, and the traces appear fine. Other times, the app might blow up with a segmentation fault at an unexpected place, robbing us of the chance to put in a breakpoint and figure out what’s going on. When these problems occur, we have to fall back to standard debugging techniques and narrow things down until we find the problem.[94]
One of the easiest methods to get wrong is glVertexAttribPointer (see Associating an Array of Vertex Data with an Attribute for a refresher), and getting it wrong will often lead to strange display issues and segmentation faults. As an example, let’s say that we have a vertex array for an object with a position attribute, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access