首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >openal中的alutCreateBufferHelloWorld ()

openal中的alutCreateBufferHelloWorld ()
EN

Stack Overflow用户
提问于 2009-11-08 00:03:35
回答 1查看 543关注 0票数 0

我再一次需要你的帮助来编写开场白

我是一个编程新手,从vc++ 6开始学习openal

我是从sdk1.1的文档中了解到的

有了这个程序

代码语言:javascript
复制
#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 \OpenAL\open AL test\EX\mi\ãanta7\9\cpp9.cpp(55):error C2065:'alutCreateBufferHelloWorld‘:执行cl.exe时出现未声明的标识符错误。

我不知道问题出在哪里

感谢alote

EN

回答 1

Stack Overflow用户

发布于 2009-11-08 00:30:58

要么是找不到alut.h头文件,在这种情况下,你大概也会收到一个错误;要么是你的ALUT版本太旧,因此在API中没有alutCreateBufferHelloWorld

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1693499

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档