glMatrixMode(GL_MODELVIEW);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
glVertex3f(1.0f, 1.0f,0.0f);
glColor4f(0.0f, 1.0f, 0.0f, 1.0f);
glVertex3f(-1.0f, 1.0f,0.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
glVertex3f(-1.0f, -1.0f,0.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
glVertex3f(1.0f, 1.0f,0.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
glVertex3f(-1.0f, -1.0f,0.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
glVertex3f(1.0f, -1.0f,0.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
glEnd();
glFlush();
SwapBuffers(dc.m_ps.hdc);
GLsizei width, height;
GLdouble aspect;
width = cx;
height = cy;
if (cy==0)
aspect = (GLdouble)width;
else
aspect = (GLdouble)width/(GLdouble)height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 500.0 * aspect, 0.0, 500);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glDrawBuffer(GL_BACK);
glBegin(GL_POLYGON);