Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using alBufferDataStatic()



That worked great and was trivial to call. Thanks!  I'm now streaming to OpenAL with static buffers.

--Chris

On Jun 17, 2009, at 6:16 PM, Bob Aron wrote:

Chris,

Since alBufferDataStatic() is actually an extension and not part of the OpenAL spec, the correct practice is to retrieve a function ptr for this API via alGetProcAddress(). This ensures that the application has no runtime linkage issues should the API not be present. So you can do something like this in your application and then just call your function.

ALvoid  alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq)
{
    static alBufferDataStaticProcPtr proc = NULL;
    
    if (proc == NULL) {
        proc = (alBufferDataStaticProcPtr) alGetProcAddress((const ALCchar*) "alBufferDataStatic");
    }
    
    if (proc)
        proc(bid, format, data, size, freq);

    return;
}
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/coreaudio-api/email@hidden

This email sent to email@hidden

References: 
 >Using alBufferDataStatic() (From: Chris Adamson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.