1.3. 執行模型 Execution Model
The OpenGL API is focused on drawing graphics into frame buffer memory and, to a lesser
extent, in reading back values stored in that frame buffer. It is somewhat unique in that its
design includes support for drawing threedimensional geometry (such as points, lines, and
polygons, collectively referred to as PRIMITIVES) as well as for drawing images and bitmaps.
The execution model for OpenGL can be described as client-server. An application program (the
client) issues OpenGL commands that are interpreted and processed by an OpenGL
implementation (the server). The application program and the OpenGL implementation can
execute on a single computer or on two different computers. Some OpenGL state is stored in
the address space of the application (client state), but the majority of it is stored in the address
space of the OpenGL implementation (server state).
OpenGL commands are always processed in the order in which they are received by the server,
although command completion may be delayed due to intermediate operations that cause
OpenGL commands to be buffered. Out-of-order execution of OpenGL commands is not
permitted. This means, for example, that a primitive will not be drawn until the previous
primitive has been completely drawn. This in-order execution also applies to queries of state
and frame buffer read operations. These commands return results that are consistent with
complete execution of all previous commands.
Data binding for OpenGL occurs when commands are issued, not when they are executed. Data
passed to an OpenGL command is interpreted when the command is issued and copied into
OpenGL memory if needed. Subsequent changes to this data by the application have no effect
on the data that is now stored within OpenGL.