State and State Requests

A good part of OpenAL state is attributed to and stored in association with OpenAL objects. However, some state - e.g. processing errors - is defined to global (yet Context specific and handled on a per-Context basis). OpenAL also has global state that affects all objects and processing equally. This state is set using a variety of functions, and can be queried using query functions. The majority of queries has to use the interface described in "Simple Queries".

Querying OpenAL State

Simple Queries

Like OpenGL, OpenAL uses a simplified interface for querying global state. The following functions accept a set of enumerations. Legal values are listed along with the matching commands to set the state.

void GetBooleanv ( enum paramName , boolean * dest );

void GetIntegerv ( enum paramName , int * dest );

void GetFloatv ( enum paramName , float * dest );

void GetDoublev ( enum paramName , double * dest );

NULL destinations are quietly ignored. INVALID_ENUM is the response to errors in specifying paramName. The amount of memory required in the destination depends on the actual state requested. Usually, state variables are returned in only one or some of the formats above.

To query state controlled by Enable/Disable there is an additional IsEnabled function defined (see "Controlling OpenAL Execution").

String Queries

The application can retrieve state information global to the current OpenAL Context. GetString will return a pointer to a constant string. Valid values for param are VERSION, RENDERER, VENDOR, and EXTENSIONS, as well as the error codes defined by OpenAL. The application can use GetString to retrieve a string for an error code.

const ubyte * GetString ( enum paramName);