glVertex2d(0.9,0.1);
glColor3d(0.0,0.0,1.0);
glVertex2d(0.9,0.9);
glColor3d(1.0,0.0,1.0);
glVertex2d(0.1,0.9);
glEnd();
glFlush();
}
GLvoid CALLBACK left(AUX_EVENTREC *event)
{
printf("%d,%d\n",event->data[AUX_MOUSEX],event-
>data[AUX_MOUSEY]);
}
GLvoid CALLBACK resize(GLsizei w,GLsizei h)
{
glLoadIdentity();
glViewport(0,0,w/2,h/2);
glOrtho(-1.0,1.0,-1.0,1.0,0.0,1.0);
}
int main(int argc, char *argv[])
{
auxInitPosition(200,100,640,480);
auxInitDisplayMode(AUX_RGBA);
auxInitWindow(argv[0]);
auxReshapeFunc(resize);
/*hàm mới*/
auxMouseFunc(AUX_LEFTBUTTON,AUX_MOUSEDOWN,left);
/*hàm mới*/
auxMainLoop(draw);
return 0;
}