2017年4月24日 星期一

week10溫洺漢上課筆記

將MP3放到這裡面來
加入以下程式\#include "CMP3_MCI.h"CMP3_MCI myMP3;    myMP3.Load("C:\\Users\\user\\Desktop\\freeglut\\bin\\yukai.MP3");    myMP3.Play();
加入以下程式 glutKeyboardFunc(keyboard);來製造出鋼琴的聲音void keyboard(unsigned char key, int x, int y){    if(key=='1') PlaySound("Do.wav",NULL,SND_ASYNC);    if(key=='2') PlaySound("Re.wav",NULL,SND_ASYNC);    if(key=='3') PlaySound("Mi.wav",NULL,SND_ASYNC);    if(key=='4') PlaySound("Fa.wav",NULL,SND_ASYNC);    if(key=='5') PlaySound("So.wav",NULL,SND_ASYNC);}
加入以下程式#include <mmsystem.h>voidmouse(int button, int state, int x, int y)                                             {PlaySound("C:\\users\\user\\Desktop\\lesson32/Data/shot.wav",NULL,SND_ASYNC);}
glutMouseFunc(mouse);
遊戲執行的時候

先到nehe lesson 32下載lesson 31-35的射擊遊戲,並下載visual c++然後開啟解壓縮,然後開啟lesson 32並按否來開啟

沒有留言:

張貼留言