1.開啟GLUT專案,把CodeBlocks Project.cbp用Notepad++(workung-dir="..."改成 . 小數點),將freegliut\bin\freegliut32.dll複製到專案目錄
2.下載CMP3_MCI.H、MP3檔(要Media Player可以播的)放在專案目錄
#include <mmsystem.h>
#include "CMP3_MCI.h"
CMP3_MCI myMP3;
int main(...)
{
myMP3.Load("123.mp3");///下載的mp3
myMP3.Play();
}
3.
void timer(int t)
{
glutTimerFunc(2000, timer, t+1);///2000=2s
PlaySound("Shot.wav", NULL, SND_ASYNC);
}
...
在main()裡,glutCreateWindow("...")之後
glutTimerFunc(6000, timer, 0);
4.內差公式(交叉相乘)=a*新+(1-a)舊
沒有留言:
張貼留言