glutKeybordFunc()
void keybord(unsigned char c, int x, int y){
if('1'==c) PlaySound("pianoC.wav",NULL,SND_ASYNC);
if('2'==c) PlaySound("pianoD.wav",NULL,SND_ASYNC);
if('3'==c) PlaySound("pianoE.wav",NULL,SND_ASYNC);
if('4'==c) PlaySound("pianoF.wav",NULL,SND_ASYNC);
if('5'==c) PlaySound("pianoG.wav",NULL,SND_ASYNC);
if('6'==c) PlaySound("pianoA.wav",NULL,SND_ASYNC);
if('7'==c) PlaySound("pianoB.wav",NULL,SND_ASYNC);
if('8'==c) PlaySound("pianoC2.wav",NULL,SND_ASYNC);
}
加上去後就有聲音囉
沒有留言:
張貼留言