NeHe Lesson 32 射擊小遊戲

開新專案 GLUT
INCLUDE多媒體標題檔
#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);
}
在main中加入
glutMouseFunc(mouse);
========================================================================
鍵盤函式
void keyboard(unsigned char key,int x,int y)
{
if(key=='1')PlaySound("C:\\Users\\user\\Desktop\\Lesson32\\Data\\shot.wav",NULL,SND_ASYNC)
}
在main中加入
glutKeyboardFunc(keyboard);
========================================================================
搜尋 CMP3_MCI

#include "CMP3_MCI.h"
CMP3_MCI myMP3; 宣告變數
在main中加入
myMP3.Load("C:\\Users\\user\\Downloads\\MC.mp3"); ( )中輸入檔案位置
myMP3.Play();
沒有留言:
張貼留言