[Openal] Initializing effects extension

Margin Marh marginproduction at gmail.com
Sat Apr 4 12:41:33 PDT 2009


After experimenting with OpenAL static sound i wanted to move further to 3d
sound, effects.
So i opened the Effect extension.pdf that comes with Openal and started
reading but i got stuck on tutorial 1(Initializing the effect extension).
I did not understand most of the parts(the red words in the code are the
ones i don't understand)...
Trying my hard to understand i was able to put this code together :

#include <stdio.h>
> #include <al.h>
> #include <alc.h>
> #include <iostream>
> using namespace std;
>
> int main()
> {
>     ALCcontext *Context;
>     ALCdevice *Device;
>     ALint attribs[4] = { 0 };
>     ALint iSends =0;
>
>         Device = alcOpenDevice(NULL);
>         if (Device)
>         {
>         cout<<"Device succesfully created"<<endl;
>         }
>         if(!Device)
>         {
>             cout<<"Device not succesfully created"<<endl;
>             alcCloseDevice(Device);
>             return 0;
>         }
>
>         if (alcIsExtensionPresent(Device, "ALC_EXT_EFX") == ALC_FALSE)
>         {
>             cout<<"EFX extention is not found"<<endl;
>         }
>         else if (alcIsExtensionPresent(Device, "ALC_EXT_EFX") ==ALC_TRUE)
>         {
>             cout<<"EFX Extension found!"<<endl;
>         }
>         attribs[0] = ALC_MAX_AUXILIARY_SENDS;
>         attribs[1] = 4;
>
>         Context=alcCreateContext(Device,attribs);

        alcMakeContextCurrent(Context);
>         alcGetIntegerv(Device, ALC_MAX_AUXILIARY_SENDS, 1, &iSends);
>
>         printf("Device supports %d Aux Sends per Source\n", iSends);
>
>         alGenEffects=(LPALGENEFFECTS);
>         alGetProcAddress("alGenEffects");
>         alDeleteEffects=(LPALDELETEEFFECTS);
>         alGetProcAddress("alDeleteEffects");
>         alIsEffect=(LPALISEFFECT);
>         alGetProcAddress("alIsEffect");
>
>
>         if (!(alGenEffects && alDeleteEffects && alIsEffect))
>         {
>         cout<<"error"<<endl;
>         }
>         else
>         {
>             cout<<"worked"<<endl;
>         }
>         cin.get();
>         alcDestroyContext(Context);
>         alcCloseDevice(Device);
>             return 0;
> }


But the problem is that when i build it i get allot of "undeclared
identifier" errors...
The full list of errors is here :

> 'ALC_MAX_AUXILIARY_SENDS' : undeclared identifier
> 'ALC_MAX_AUXILIARY_SENDS' : undeclared identifier
> 'alGenEffects' : undeclared identifier
> 'LPALGENEFFECTS' : undeclared identifier
> 'alDeleteEffects' : undeclared identifier
> 'LPALDELETEEFFECTS' : undeclared identifier
> 'alIsEffect' : undeclared identifier
> 'LPALISEFFECT' : undeclared identifier
> 'alGenEffects' : undeclared identifier
> 'alDeleteEffects' : undeclared identifier
> 'alIsEffect' : undeclared identifier
>
If i am not mistaking its cause i did not declare them i got this error but
i don't know what type of Openal type i have to declare them as...
Also the red parts of the code is the parts i did not understand, so if its
possible can i get some explanation ?
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20090404/3a6253e4/attachment.html


More information about the Openal mailing list