Sending Data to OpenGL

After we’ve initialized our buffers, we can request geometric primitives be rendered by calling one of OpenGL’s drawing commands, such as glDrawArrays(), as we did in Example 1.1.

Drawing in OpenGL usually means transferring vertex data to the OpenGL server. Think of a vertex as a bundle of data values that are processed together. While the data in the bundle can be anything you’d like it to be (i.e., you define all the data that makes up a vertex), it almost always includes positional data. Any other data will be values you’ll need to determine the pixel’s final color.

Drawing commands are covered in detail in Chapter 3, “Drawing with OpenGL”.

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.