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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.