AL Contexts and the ALC API

This section of the AL specification describes ALC, the AL Context API. ALC is a portable API for managing OpenAL contexts, including resource sharing, locking, and unlocking. Within the core AL API the existence of a Context is implied, but the Context is not exposed. The Context encapsulates the state of a given intance of the AL state machine.

To avoid confusion with the AL related prefixes implied throughout this document, the "alc" and "ALC_" prefixes have been made explicit in the ALC related sections.

ALC defines the following objects: Contexts.

Error Handling

ALC uses the same conventions and mechanisms as AL for error handling. In particular, ALC does not use conventions derived from X11 (GLX) or Windows (WGL). The alcGetError function can be used to query ALC errors.

enum alcGetError(void);

Error codes can be mapped to strings. OpenAL returns a pointer to a constant (possibly literal) string that is identical to the enumeration name as defined in the specification.

const ubyte alcGetErrorString(enum errorCode);

Table 1. Error Conditions

NameDescription
ALC_NO_ERRORThere is no accessible sound device/driver/server.
ALC_INVALID_CONTEXTThe Context argument does not name a valid context.