2009-11-07 39 views
0

我又需要你的幫助編程的OpenAL的alutCreateBufferHelloWorld()中的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):error C2065:'alutCreateBufferHelloWorld':未聲明的標識符 執行cl 。可執行程序。

,我不konw是什麼問題

感謝alote

+0

oooooooooooooh真的,我需要你的幫助>>>和quikly ,我需要你對我應該做的究竟是什麼,瞭解1個月怎麼我需要它ñ我的畢業設計,什麼是最好的郎過程中的OpenAL編程幫助。學習 – maiajam 2009-11-07 16:28:23

回答

1

無論是它的失敗找alut.h頭,在這種情況下,想必你會得到一個錯誤,太多,或者你的版本ALUT太舊,因此在API中沒有alutCreateBufferHelloWorld

+0

謝謝>>>>但我怎麼知道我的ALUT的版本是什麼以及ALUT的最後版本是什麼,從哪裏我可以下載它 – maiajam 2009-11-07 16:44:05

+0

@maiajam ALUT是一個非常古老的圖書館,它非常不容置疑,您可以使用OpenAL Soft,它非常簡單。您需要一個WAVE閱讀器,以及幾個可以在任何OpenAL教程中找到的調用。 – greenfox 2014-12-14 01:41:42