先在google尋找:NeHe Lesson 32
下載壓縮檔並解壓縮
玩遊戲(NEHE)
把槍聲特效加進GLUT專案裡
#include <mmsystem.h>void mouse(int button,int state,int x,int y){
PlaySound("C:\\Users\\user\\Desktop\\Lesson32\\data/shot.wav",NULL,SND_ASYNC);
}
glutMouseFunc(mouse);
利用程式播出音樂
加入程式碼:
#include "CMP3_MCI.h"
CMP3_MCI myMP3;
int main(int argc, char *argv[]){
myMP3.Load("C:\\Users\\user\\Desktop\\freeglut\\bin/yukai.mp3");///音樂檔的路徑
myMP3.Play();
glutInit(&argc, argv);
沒有留言:
張貼留言