10.02.2014 Views

spec - OpenGL

spec - OpenGL

spec - OpenGL

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.3. GL COMMAND SYNTAX 14<br />

Type Descriptor<br />

b<br />

s<br />

i<br />

i64<br />

f<br />

d<br />

ub<br />

us<br />

ui<br />

ui64<br />

Corresponding GL Type<br />

byte<br />

short<br />

int<br />

int64<br />

float<br />

double<br />

ubyte<br />

ushort<br />

uint<br />

uint64<br />

Table 2.1: Correspondence of command suffix type descriptors to GL argument<br />

types. Refer to table 2.2 for definitions of the GL types.<br />

and<br />

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

These examples show the ANSI C declarations for these commands. In general,<br />

a command declaration has the form 3<br />

rtype Name{ɛ1234}{ɛ b s i i64 f d ub us ui ui64}{ɛv}<br />

( [args ,] T arg1 , . . . , T argN [, args] );<br />

rtype is the return type of the function. The braces ({}) enclose a series of type<br />

descriptors (see table 2.1), of which one is selected. ɛ indicates no type descriptor.<br />

The arguments enclosed in brackets ([args ,] and [, args]) may or may not be<br />

present. The N arguments arg1 through argN have type T, which corresponds to<br />

one of the type descriptors indicated in table 2.1 (if there are no letters, then the<br />

arguments’ type is given explicitly). If the final character is not v, then N is given<br />

by the digit 1, 2, 3, or 4 (if there is no digit, then the number of arguments is fixed).<br />

If the final character is v, then only arg1 is present and it is an array of N values of<br />

the indicated type.<br />

For example,<br />

void Uniform{1234}{if}( int location, T value );<br />

3 The declarations shown in this document apply to ANSI C. Languages such as C++ and Ada<br />

that allow passing of argument type information admit simpler declarations and fewer entry points.<br />

<strong>OpenGL</strong> 4.2 (Compatibility Profile) - August 22, 2011

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

Saved successfully!

Ooh no, something went wrong!