Creating and Initializing Textures

The first step in using textures in OpenGL is to reserve names for texture objects and bind them to the context’s texture units. To create a texture, as with many other objects in OpenGL, names are reserved and then bound to their appropriate target. To reserve names for texture objects, call glGenTextures(), specifying the number of names to reserve and the address of an array into which to deposit the names.

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.