2024年5月30日 星期四

Han Week15

#week15

##week15_PlaySound

0.freeglut安裝

1.File-New-Project,GLUT專案week15_PlaySound

2.添加程式碼

#include<windows.h>

PlaySound("c:/mykbeat.wav",NULL,SND_ASYNC);




第二種


##week15-2_PlaySound_empty
1.File-New-Project,GLUT專案week15-2_PlaySound_empty
2.程式碼全刪

現在要把你的工作執行目錄Project-Properties的第二分頁
Execution working dir改成小數點
再把 桌面\freeglut\bin\freeglut.dll及音樂,都Copy到專案目錄
(1)




(2)按1,2,3分別有Do Re Mi


##week15-3_CMP3_MCI
1.File-New-Project,GLUT專案week15-3_CMP3_MCI
2.請把CMP3_MCI.h和sone.mp3和freeglut.dll都放到你的專案目錄裡
3.把你的工作執行目錄,設成小數點
```cpp
#include "CMP3_MCI.h"//雙引號,很像之前"glm.h"
CMP3_MCI myMP3;//宣告一個物件變數

```
在main()裡
```cpp
int main(...)
{
    myMP3.Load("song.mp3");
    myMP3.Play();
...
}
```

##week15-4_mouse_motion_translate_rotate
1.File-New-Project,GLUT專案week15-4_mouse_motion_translate_rotate
2.貼上11行程式
3.目標:先能移動 旋轉 陣列













沒有留言:

張貼留言