Week 11-1 keyboard
1.開啟GLUT專案,創建完後再 main.cpp 中 ctrl+F 尋找 keyboard 關鍵字的相關程式
2.向上找到 static void key 這列程式碼參考,裡面有關於按鍵控制的程式
3.依照參考及老師的指示打出鍵盤按鍵控制的程式碼
Week 11-2 PlaySound
3.利用添加程式碼 kayboard + PlaySound 來播放指定音檔
SND_SYNC 等待 不同步撥放
Week 11-3 PlaySound
1.開新檔案Empty file,在Settings > compiler > Linker setting add 添加 winmm
2.實作在顯示 hello world 的時候透過 PlaySound 發出聲音提示
3.相對路徑與絕對路徑
絕對路徑需要打雙斜線及完整的資料存放路徑才會讀取
Week 11-4 CMP3_MCI
1.創建新的GLUT專案,往下滑至 int main 行
2.將老師提供的 CMP3_MCI.h 放入程式目錄裡
3.寫入程式
#include "CMP3_MCI.h"
CMP3_MCI myMP3;
int main()
{
char filename[] = "C:/Users/Administrator/Desktop/do-re-mi/音檔名.mp3";
myMP3.Load(filename);
myMP3.Play();
可只改為一個點,會針對當前程式存放資料夾讀取
同時要記得如讀不到 freeglut.dll ,要將freeglut.dll丟入程式當前目錄裡
為此需要先將github的 2023graphicsb 先 clone 下來
2.對 2023graphicsb 資料夾裡的 .gitignore 進行更改,針對.dll進行註解
接著照原本的步驟進行github上傳就完成了
沒有留言:
張貼留言