alutCreateBufferHelloWorld()在openal中

时间:2009-11-07 16:03:35

标签: c++ openal

我需要你的帮助再次编写openal

我是一般编程的新手>>并开始通过vc ++ 6学习openal

我正在从与sdk1.1

相关的文档中学习它

并拥有此计划

#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <al.h>
#include <alc.h>
#include <alut.h>
#pragma comment(lib, "openal32.lib")
#pragma comment(lib, "alut.lib")


 ALCdevice *alcOpenDevice(ALCdevice *device);


 ALCenum alcGetError( ALCdevice *device );



 ALuint buffer ;
ALuint source;

// Position of the source sound.
ALfloat SourcePos[] = { 0.0, 0.0, 0.0 };

// Velocity of the source sound.
ALfloat SourceVel[] = { 0.0, 0.0, 0.0 };


// Position of the Listener.
ALfloat ListenerPos[] = { 0.0, 0.0, 0.0 };

// Velocity of the Listener.
ALfloat ListenerVel[] = { 0.0, 0.0, 0.0 };

// Orientation of the Listener. (first 3 elements are "at", second 3 are "up")
// Also note that these should be units of '1'.
ALfloat ListenerOri[] = { 0.0, 0.0, -1.0,  0.0, 1.0, 0.0 };



int  main()
{




alGenSources(1,&source);








 alSourcei (source, AL_BUFFER,  alutCreateBufferHelloWorld ());  

    alSourcef (source, AL_PITCH,    10.0      );
    alSourcef (source, AL_GAIN,     10.0      );
    //alSourcefv(source, AL_POSITION, SourcePos);
    //alSourcefv(source, AL_VELOCITY, SourceVel);
//  alSourcei (source, AL_LOOPING,  loop     );


alSourcePlay(source);


 alDeleteSources(1, &source);
return 0;

};

我有错误

C:\ Users \ Toshiba \ Desktop \ Graduation Project \ OpenAL \ open AL test \ EX \ mi \ããÇá\ 7 \ 9 \ Cpp9.cpp(55):错误C2065:'alutCreateBufferHelloWorld':未声明的标识符 执行cl.exe时出错。

我不知道问题是什么

感谢alote

1 个答案:

答案 0 :(得分:1)

要么没有找到alut.h标头,在这种情况下你可能会得到一个错误,或者你的ALUT版本太旧,因此API中没有alutCreateBufferHelloWorld。 / p>