在CodeBolock 新增一個 Project (GLUT)
在 Project -> Build options 設定路徑
將 CMP3_MCI.h 新增到專案裡
將 MP3檔放到freeglut的bin裡面
程式碼如下:
#include <iostream>
//#include <GL/glut.h>
#include "CMP3_MCI.h"
CMP3_MCI myMP3;
using namespace std;
int main()
{
myMP3.Load("Style.mp3");
myMP3.Play();
cout << "Hello myMP3" <<endl;
int a;
cin>>a; ///輸入後才結束程式,要不然程式一開始音樂還沒播完,就會結束
return 0;
}
沒有留言:
張貼留言