10.02.2014 Views

spec - OpenGL

spec - OpenGL

spec - OpenGL

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

2.5. GL ERRORS 18<br />

a viewing volume in preparation for the next stage, rasterization. The rasterizer<br />

produces a series of framebuffer addresses and values using a two-dimensional<br />

description of a point, line segment, or polygon. Each fragment so produced is<br />

fed to the next stage that performs operations on individual fragments before they<br />

finally alter the framebuffer. These operations include conditional updates into the<br />

framebuffer based on incoming and previously stored depth values (to effect depth<br />

buffering), blending of incoming fragment colors with stored colors, as well as<br />

masking and other logical operations on fragment values.<br />

Finally, there is a way to bypass the vertex processing portion of the pipeline to<br />

send a block of fragments directly to the individual fragment operations, eventually<br />

causing a block of pixels to be written to the framebuffer; values may also be read<br />

back from the framebuffer or copied from one portion of the framebuffer to another.<br />

These transfers may include some type of decoding or encoding.<br />

This ordering is meant only as a tool for describing the GL, not as a strict rule<br />

of how the GL is implemented, and we present it only as a means to organize the<br />

various operations of the GL. Objects such as curved surfaces, for instance, may<br />

be transformed before they are converted to polygons.<br />

2.5 GL Errors<br />

The GL detects only a subset of those conditions that could be considered errors.<br />

This is because in many cases error checking would adversely impact the performance<br />

of an error-free program.<br />

The command<br />

enum GetError( void );<br />

is used to obtain error information. Each detectable error is assigned a numeric<br />

code. When an error is detected, a flag is set and the code is recorded. Further<br />

errors, if they occur, do not affect this recorded code. When GetError is called,<br />

the code is returned and the flag is cleared, so that a further error will again record<br />

its code. If a call to GetError returns NO_ERROR, then there has been no detectable<br />

error since the last call to GetError (or since the GL was initialized).<br />

To allow for distributed implementations, there may be several flag-code pairs.<br />

In this case, after a call to GetError returns a value other than NO_ERROR each<br />

subsequent call returns the non-zero code of a distinct flag-code pair (in un<strong>spec</strong>ified<br />

order), until all non-NO_ERROR codes have been returned. When there are no more<br />

non-NO_ERROR error codes, all flags are reset. This scheme requires some positive<br />

number of pairs of a flag bit and an integer. The initial state of all flags is cleared<br />

and the initial value of all codes is NO_ERROR.<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!