ALCapabilities classes. An ALCapabilities instance contains flags for functionality that is available in an OpenAL
context. Internally, it also contains function pointers that are only valid in that specific OpenAL context.ALCapabilities instances, corresponding to OpenAL contexts that are current in those threads and the
entire process, respectively.Instances of ALCapabilities can be created with the createCapabilities method. An OpenAL context must be current in the current thread
or process before it is called. Calling this method is expensive, so ALCapabilities instances should be cached in user code.
Before a function for a given OpenAL context can be called, the corresponding ALCapabilities instance must be made current in the current
thread or process. The user is also responsible for clearing the current ALCapabilities instance when the context is destroyed or made current in
another thread.
Note that OpenAL contexts are made current process-wide by default. Current thread-local contexts are only available if the
ALC_EXT_thread_local_context extension is supported by the OpenAL implementation. OpenAL Soft, the implementation
that LWJGL ships with, supports this extension and performs better when it is used.
ALC
| Modifier and Type | Class and Description |
|---|---|
| private static interface | AL.
Function pointer provider. |
| private static class | AL.
Write-once |
| Modifier and Type | Field and Description |
|---|---|
| private static final ThreadLocal | |
| private static AL. | |
| private static ALCapabilities |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static ALCapabilities | |
| public static ALCapabilities | Returns: the ALCapabilities instancethe alcCaps)ALCCapabilities of the device associated with the current contextCreates a new |
| public static ALCapabilities | Returns: the ALCapabilities instancethe alcCaps, IntFunction<PointerBuffer> ALCCapabilities of the device associated with the current contexta function that allocates a bufferFactory)PointerBuffer given a size. The buffer must be filled with zeroes. If null, LWJGL will
allocate a GC-managed buffer internally.Creates a new |
| pack-priv static void | |
| public static ALCapabilities | getCapabilities()
Returns the |
| pack-priv static ALCapabilities | |
| pack-priv static void | |
| public static void | setCurrentProcess(ALCapabilities
the caps)ALCapabilities to make current, or nullSets the specified |
| public static void | setCurrentThread(ALCapabilities
the caps)ALCapabilities to make current, or nullSets the specified |
| capabilitiesTLS | back to summary |
|---|---|
| private static final ThreadLocal<ALCapabilities> capabilitiesTLS | |
| icd | back to summary |
|---|---|
| private static AL. | |
| processCaps | back to summary |
|---|---|
| private static ALCapabilities processCaps
| |
| AL | back to summary |
|---|---|
| private AL() | |
| checkCapabilities | back to summary |
|---|---|
| private static ALCapabilities checkCapabilities(ALCapabilities caps) | |
| createCapabilities | back to summary |
|---|---|
| public static ALCapabilities createCapabilities(ALCCapabilities alcCaps) Creates a new This method calls
| |
| createCapabilities | back to summary |
|---|---|
| public static ALCapabilities createCapabilities(ALCCapabilities alcCaps, IntFunction<PointerBuffer> bufferFactory) Creates a new
| |
| destroy | back to summary |
|---|---|
| pack-priv static void destroy() | |
| getCapabilities | back to summary |
|---|---|
| public static ALCapabilities getCapabilities() Returns the
| |
| getICD | back to summary |
|---|---|
| pack-priv static ALCapabilities getICD() | |
| init | back to summary |
|---|---|
| pack-priv static void init() | |
| setCurrentProcess | back to summary |
|---|---|
| public static void setCurrentProcess(ALCapabilities caps) Sets the specified If the current thread had a context current (see
| |
| setCurrentThread | back to summary |
|---|---|
| public static void setCurrentThread(ALCapabilities caps) Sets the specified Any OpenAL functions called in the current thread will use the specified
| |
| Modifier and Type | Method and Description |
|---|---|
| public ALCapabilities | |
| public default void |
| get | back to summary |
|---|---|
public ALCapabilities get()
| |
| set | back to summary |
|---|---|
| public default void set(ALCapabilities caps) | |
ICD.
This is the default implementation that skips the thread/process lookup. When a new ALCapabilities is set, we compare it to the write-once capabilities. If different function pointers are found, we fall back to the expensive lookup. This will never happen with the OpenAL-Soft implementation.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static ALCapabilities |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ALCapabilities | |
| public void |
| tempCaps | back to summary |
|---|---|
| private static ALCapabilities tempCaps
| |
| ICDStatic | back to summary |
|---|---|
| private ICDStatic() | |
| get | back to summary |
|---|---|
| public ALCapabilities get() Implements org.
| |
| set | back to summary |
|---|---|
| public void set(ALCapabilities caps) Overrides default org.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final ALCapabilities |
| Access | Constructor and Description |
|---|---|
| private |
| caps | back to summary |
|---|---|
| pack-priv static final ALCapabilities caps | |
| WriteOnce | back to summary |
|---|---|
| private WriteOnce() | |