2024年5月27日 星期一

阿哲 week15

 #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-week15-2_CMP#_MCI

2.將CMP3_MCI.h放在week15-2_CMP#_MCI目錄裡

        cpp

#include <stdio.h> //為了scanf()

#include "CMP3-MCI.h" //記得要用雙印號,不能用角括號

CMP#_MCI myMP3; //宣告一個變數,名子叫myMP3

int main()

{
        myMP3.Load("filename.mp3");

        myMP3.Play();


        int a; ///幫忙卡住,程式不要快速結束

        scanf("%d",&a);

}

##week15-2_CMP3_MCI_sample
1.File-week15-2_CMP3_MCI_sampl3
2.把CMP3_MCI.h 放在同一個目錄 week15-2_CMP3_MCI_sample裡
3.不要刪177行的範例 插入#include "CMP3_MCI.h"

        cpp
#include "CMP3_MCI.h"

再插入
        cpp
myMP3.Load("filename.mp3);
myMP3.Play();

##week15-3_mouse_motion_glTranslatef_glRotatef
1file-week15-3_mouse_motion_glTranslatef_glRotatef
2.貼上11行GLUT簡單版本

        cpp
#include<GL/glut.h>
int main(int argc,char**argv)
{
    glutInit(&argc,argv);
glutInitDisplayMOde(GLUT_DOUBLE|GLUT_DETPH);
glutCreateWindow("week15-3")
glutDisplayFunc(display);

有程式

glutMainLoop();
}

沒有留言:

張貼留言