#week15
##week15-1_PlaySound
0.安裝 freeglut
1.新增 File-New-Project GLUT 專案
2.全刪 只寫一行
'''cpp
#include<windows.h>
#include <GL/glut.h>
int main()
{
PlaySound("filename.wav",NULL,SND_SYNC);
//等待播完音樂,才結束
}
'''
去找wav檔(不能是MP3檔)
##week15-2_CMP3_MCI
1.File-New-Project GLUT專案 week15-2_CMP3_MCI
2.老師準備了CMP3_MCI.h傳給你了
'''cpp
#include <stdio.h>
#include "CMP3_MCI.h" //記得要用雙引號 不能用角括號
CMP3_MCI myMP3; //宣告一個變數 名字叫myMP3
int main()
{
myMP3.Load("filename.mp3");
myMP3.play();
int a;//幫忙卡住 程式不要快速結束
scanf("%d",&a);
}
##week15-2_CMP3_MCI_sample
1.File-New-Project GLUT專案
2.把CMP3_MCI.h放在同一個目錄裡
3.不要刪177範例 共存 請插入
'''cpp
#include "CMP3_MCI.h"
再插入
myMP3.Load("song.mp3");
myMP3.Play();
##week15-3_mouse_motion_glTranslatef_glRotatef
1.File-New-Project GLUT專案
2.貼上11行GLUT簡單版本(今天不用glm.cpp 不用OpenCV
'''cpp
#include<GL/glut.h>
void display(){
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glutSwapBuffers();
}
int main(int argc,char *argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DETPH);
glutCreateWindow("week15-3");
glutDisplayFunc(display);
glutMainLoop();
}
沒有留言:
張貼留言