- Code: Select all
while (!done)
{
for( int i = 0; i <= 1; i++)
{
if( i == 0)
{
glViewport(0, 0, 200, 400);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(52.0f,(GLfloat)200/(GLfloat)400,1.0f,1000.0f);
glMatrixMode(GL_MODELVIEW);
}
if(i == 1)
{
glViewport(200, 0, 200, 400);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(52.0f,(GLfloat)200/(GLfloat)400,1.0f,1000.0f);
glMatrixMode(GL_MODELVIEW);
}
if( i == 1)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glClearColor(0.0,0.0,0.0,0.0);
}
if( i == 0)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glClearColor(1.0,0.0,1.0,0.0);
}
}
SwapBuffers(hdc); //display back buffer
while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
{
if (!GetMessage (&msg, NULL, 0, 0))
{
done = true;
break;
}
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}
This is me message loop and im thinking one viewporet should be black and the other should be purpleish but they should be differnt. SO whats wrong with this?
