23.06.2013 Views

The OpenGL Graphics System: A Specification

The OpenGL Graphics System: A Specification

The OpenGL Graphics System: A Specification

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6<br />

State and State Requests<br />

<strong>The</strong> state required to describe the GL machine is enumerated in section 6.2. Most<br />

state is set through the calls described in previous chapters, and can be queried<br />

using the calls described in section 6.1.<br />

6.1 Querying GL State<br />

6.1.1 Simple Queries<br />

Much of the GL state is completely identified by symbolic constants. <strong>The</strong> values<br />

of these state variables can be obtained using a set of Get commands. <strong>The</strong>re are<br />

four commands for obtaining simple state variables:<br />

void GetBooleanv( enum value, boolean *data );<br />

void GetIntegerv( enum value, int *data );<br />

void GetFloatv( enum value, float *data );<br />

void GetDoublev( enum value, double *data );<br />

<strong>The</strong> commands obtain boolean, integer, floating-point, or double-precision state<br />

variables. value is a symbolic constant indicating the state variable to return. data<br />

is a pointer to a scalar or array of the indicated type in which to place the returned<br />

data. In addition<br />

boolean IsEnabled( enum value );<br />

can be used to determine if value is currently enabled (as with Enable) or disabled.<br />

244

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!