2015年4月8日 星期三

Week07 黃冠中

#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 keyboard(unsigned char key, int x,int y)
{
    if(key=='1')PlaySound("Do.WAV",NULL,SND_ASYNC);   
    if(key=='2')PlaySound("Re.WAV",NULL,SND_ASYNC);
    if(key=='3')PlaySound("Mi.WAV",NULL,SND_ASYNC);
    if(key=='4')PlaySound("Fa.WAV",NULL,SND_ASYNC);
    if(key=='5')PlaySound("So.WAV",NULL,SND_ASYNC);
    if(key=='6')PlaySound("La.WAV",NULL,SND_ASYNC);
    if(key=='7')PlaySound("Si.WAV",NULL,SND_ASYNC);         
}
void mouse(int button,int state,int x,int y)
{
    printf("Playing sound\n");
    PlaySound("atchoum.wav",NULL,SND_ASYNC); 
}
int main(int argc,char **argv)
{
    glutInit(&argc, argv);

    glutCreateWindow("02160120");

    glutDisplayFunc(display);
    glutKeyboardFunc(keyboard);

    glutMouseFunc(mouse);

    glutMainLoop();
}

沒有留言:

張貼留言