1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
void LeftView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
ASSERT_VALID(pDoc);
glMatrixMode(GL_MODELVIEW);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
glVertex2f(100.0f, 50.0f);
glColor4f(0.0f, 1.0f, 0.0f, 1.0f);
glVertex2f(275.0f, 400.0f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
glVertex2f(450.0f, 50.0f);
glEnd();
glFlush();
CRect r1(0,0,100,100);
CPen pen(PS_SOLID,1,RGB(0,0,255));
CBrush brush(RGB(0,255,0));
pDC->SelectObject(&pen);
pDC->SelectObject(&brush);
pDC->Rectangle(r1);
pDC->DrawText("LEFT VIEW",r1,DT_CENTER);
} |
Partager