2015年4月8日 星期三

20150408_譚崇彣_HW6

#include <GL/glut.h>
#include <mmsystem.h>
#include <stdio.h>
void display()
{
    glutSolidTeapot(0.3);
    glFlush();
}
void keyboard(unsigned char key,int x,int y)
{
    if(key=='a'){
        printf("AAA\n");
    }

    else if(key=='b'){
    printf("BBB\n");
    }
}
void mouse(int button,int state,int x,int y)
{
    printf("now playing sound\n");

    PlaySound("123.wav",NULL,SND_ASYNC);  \\\路徑   freeglut\lib
}
int main(int argc, char **argv)
{
    glutInit(&argc, argv);

    glutCreateWindow("01163611");

    glutDisplayFunc(display);

    glutKeyboardFunc(keyboard);

    glutMouseFunc(mouse);

    glutIdleFunc(display);

    glutMainLoop();
}

沒有留言:

張貼留言