Here I have code that I thought would produce a square:
glBegin(GL_QUAD_STRIP);
glVertex3f(0.0f, 0.0f, -1.0f);
glVertex3f(1.0f, 0.0f, -1.0f);
glVertex3f(1.0f, 1.0f, -1.0f);
glVertex3f(0.0f, 1.0f, -1.0f);
glEnd();
SwapBuffers(g_HDC);
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
But for some reason the actual output looks all twisted. When I use the following code it works fine:
glBegin(GL_QUAD_STRIP);
glVertex3f(1.0f, 0.0f, -1.0f);
glVertex3f(0.0f, 0.0f, -1.0f);
glVertex3f(1.0f, 1.0f, -1.0f);
glVertex3f(0.0f, 1.0f, -1.0f);
glEnd();
SwapBuffers(g_HDC);
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
I thought it was rather odd that the latter produces what I expected, while the first one doesn't. I was wondering if someone could shed some light on why that was.
The code was preceeded with all of the necessary window-creation code...the else clause of the while(!done) loop had the above code preceeded with:
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT |GL_DEPTH_BUFFER_BIT);
glColor3f(0.0f, 1.0f, 0.0f);
Thanks if you can help my feeble mind comprehend!
[edited by - Shadow1234567890 on August 11, 2002 5:00:49 PM]
What do you mean ''Someday become a programmer?'' I'm a programmer right now!