#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 play sound\n");
PlaySound("madmoo.wav",NULL,SND_ASYNC);
}
int main(int arge, char ** argv)
{
glutInit(&arge, argv);
glutCreateWindow("hello");
glutDisplayFunc(display);
glutKeyboardFunc(keyboard);
glutMouseFunc(mouse);
glutMainLoop();
}
沒有留言:
張貼留言