OpenAL Specification and Reference | ||
---|---|---|
<<< Previous | Buffers | Next >>> |
AL provides calls to obtain Buffer names, to request deletion of a Buffer object associated with a valid Buffer name, and to validate a Buffer name. Calls to control Buffer attributes are also provided.
The application requests a number of Buffers using GenBuffers.
The application requests deletion of a number of Buffers by calling DeleteBuffers.
Once deleted, Names are no longer valid for use with AL function calls. Any such use will cause an INVALID_NAME error. The implementation is free to defer actual release of resources.
IsBuffer(bname) can be used to verify deletion of a buffer. Deleting bufferName 0 is a legal NOP in both scalar and vector forms of the command. The same is true for unused buffer names, e.g. such as not allocated yet, or as released already.![]() | RFC: Force Deletion |
---|---|
If a buffer name is deleted, we could replace all occurences in queues with bname 0. This is the GL behavior for deleting the texture currently bound. |
![]() | RFC: Relasing used Buffers |
---|---|
If a Buffer is USED or QUEUED, it cannot be deleted, and the operation should fail. We have three possible responses: throw an error, deferr deletion, or force deletion by replacing every use of the buffer in question with bname zero. Throwing an error requires that we lock, verify that all specified buffers can be deleted, then perform deletion, then unlock. If there is one buffer that can not be deleted we have to throw an error and make the entire operation a NOP. Deferred deletion has its own set of problems (see other RFC). Forcing deletion makes the mistake obvious to the application for current buffers (sound artifacts) but still doesn't expose errors for queued buffers. It also requires complete consumer book-keeping for each buffer. GL uses this approach for textures at little expense because it only has one current texture. |
![]() | RFC: Deferred Buffer Release |
---|---|
Buffer deletion could be performed as a deferred operation. In this case actual deletion would be deferred until a Buffer is unused, i.e. not QUEUED or CURRENT anymore. The specification would not guarantee that they are deleted as soon as possible. However, such a deferred execution would be muddying the borders between immediate and deferred execution in general (as we might want to add scheduling and deferred commands at a later time). Introduced as the default it makes impossible for the application to force deletion or errors. Errors caused by improper use of AL will be triggered at some distance from the original mistaken command. Debugging such conditions is usually expensive. This approach also does not take into account sharing of buffers among contexts. It might be possible to introduce this behavior as a Hint() in case that it is not desirable to explicitely introduce deferred commands. |
The application can verify whether a buffer Name is valid using the IsBuffer query.
<<< Previous | Home | Next >>> |
Buffers | Up | Manipulating Buffer Attributes |