|
|

楼主 |
发表于 2008-7-2 17:48:00
|
显示全部楼层
Re:OpenAL编程?
ALCcontext *context;
ALCdevice *device;
ALuint buf,sor;
device = alcOpenDevice("DirectSound3D");
context=alcCreateContext(device,NULL);
alcMakeContextCurrent(context);
alGenBuffers(1,&buf[0]);
ALenum format;
ALvoid* data;
ALsizei size;
ALsizei sfreq;
ALboolean loop;
alutLoadWAVFile("c:\sound.wav",&format,&data,&size,&sfreq,&loop);
alBufferData(buf[0],format,data,size,sfreq);
alutUnloadWAV(format,data,size,sfreq);
alGenSources(1,&sor[0]);
alSourcei(sor[0],AL_BUFFER,buf[0]);
alSourcePlay(sor[0]);
鄙视那些逃避主义者。
写不出代码,喜欢装B,写一大堆其他跑题内容来给自己脸上贴金。
我又没逼你们写代码,写不出来又没人怪你。 |
|