glClear(GL_COLOR_BUFFER_BIT);
glClearColor(0.0,0.0,0.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_QUADS);
glColor3d(1.0,0.0,0.0);
glVertex2d(0.1,0.1);
glColor3d(0.0,1.0,0.0);
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 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); /*hàm mới*/
auxInitDisplayMode(AUX_RGBA);
auxInitWindow(argv[0]);
auxReshapeFunc(resize);
auxMainLoop(draw);
return 0;
}