The OpenGL ES Context
The information that configures OpenGL ES resides in platform-specific software data structures encapsulated within an OpenGL ES context. OpenGL ES is a state machine, which means that after a program sets a configuration value, the value remains set until the program changes the value. Information within a context may be stored in memory controlled by the CPU or in memory controlled by the GPU. OpenGL ES copies information between the two memory areas as needed, and knowing when copying happens helps to optimize programs. Chapter 9, “Optimization,” describes optimization techniques.
The internal implementation of OpenGL ES Contexts depends on the specific embedded system and the particular GPU hardware installed. The OpenGL ES API provides ANSI C language functions called by programs to interact with contexts so that programs don’t need to know much if any system-specific information.
The OpenGL ES context keeps track of the frame buffer that will be used for rendering. The context also keeps track of buffers for geometric data, colors, and so on. The context determines whether to use features such as textures and lighting, described in Chapter 3, “Textures,” and Chapter 4, “Shedding Some Light.” The context defines the current coordinate system for rendering, as described in the next section.