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

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

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

2.2. GL STATE 6<br />

Finally, command names, constants, and types are prefixed in the GL (by gl,<br />

GL , and GL, respectively in C) to reduce name clashes with other packages. <strong>The</strong><br />

prefixes are omitted in this document for clarity.<br />

2.1.1 Floating-Point Computation<br />

<strong>The</strong> GL must perform a number of floating-point operations during the course of<br />

its operation. We do not specify how floating-point numbers are to be represented<br />

or how operations on them are to be performed. We require simply that numbers’<br />

floating-point parts contain enough bits and that their exponent fields are large<br />

enough so that individual results of floating-point operations are accurate to about<br />

1 part in 10 5 . <strong>The</strong> maximum representable magnitude of a floating-point number<br />

used to represent positional, normal, or texture coordinates must be at least 2 32 ;<br />

the maximum representable magnitude for colors must be at least 2 10 . <strong>The</strong> maximum<br />

representable magnitude for all other floating-point values must be at least<br />

2 32 . x · 0 = 0 · x = 0 for any non-infinite and non-NaN x. 1 · x = x · 1 = x.<br />

x + 0 = 0 + x = x. 0 0 = 1. (Occasionally further requirements will be specified.)<br />

Most single-precision floating-point formats meet these requirements.<br />

Any representable floating-point value is legal as input to a GL command that<br />

requires floating-point data. <strong>The</strong> result of providing a value that is not a floatingpoint<br />

number to such a command is unspecified, but must not lead to GL interruption<br />

or termination. In IEEE arithmetic, for example, providing a negative zero or a<br />

denormalized number to a GL command yields predictable results, while providing<br />

a NaN or an infinity yields unspecified results.<br />

Some calculations require division. In such cases (including implied divisions<br />

required by vector normalizations), a division by zero produces an unspecified result<br />

but must not lead to GL interruption or termination.<br />

2.2 GL State<br />

<strong>The</strong> GL maintains considerable state. This document enumerates each state variable<br />

and describes how each variable can be changed. For purposes of discussion,<br />

state variables are categorized somewhat arbitrarily by their function. Although we<br />

describe the operations that the GL performs on the framebuffer, the framebuffer<br />

is not a part of GL state.<br />

We distinguish two types of state. <strong>The</strong> first type of state, called GL server<br />

state, resides in the GL server. <strong>The</strong> majority of GL state falls into this category.<br />

<strong>The</strong> second type of state, called GL client state, resides in the GL client. Unless<br />

otherwise specified, all state referred to in this document is GL server state; GL<br />

Version 2.0 - October 22, 2004

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

Saved successfully!

Ooh no, something went wrong!