Below is just the render routine, the app is at http://home.att.net/~tennisman5/TryingToCombine.zip.
I can get one or the other, I can switch the order of the 2d and the 3d and get whichever I render 2nd, but I can’t get them both on the screen at the same time.
Any ideas? They will be appreciated.
void Render()
{
// clear screen and depth buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glViewport(0, 0, width, height); // reset the viewport to new dimensions
glMatrixMode(GL_PROJECTION); // set projection matrix current matrix
glLoadIdentity(); // reset projection matrix
gluPerspective(54.0f,(GLfloat)width/(GLfloat)height,1.0f,1000.0f);
glMatrixMode(GL_MODELVIEW); // set modelview matrix
glLoadIdentity(); // reset modelview matrix
float angle = rotangle + 90.0f;
if (angle < 0.0f) angle = angle + 360.0f;
if (angle >= 360.0f) angle = angle - 360.0f;
glRotatef(angle, 0.0f, 1.0f, 0.0f);
//Now the translation. Remember, the camera stays put
//and the world's axes move. So to simulate moving the
//camera 8 to the right and 8 down, we would move the
//world's axes 8 to the left and 8 up.
float translatex = -personx;
float translatez = -personz;
glTranslatef(translatex, -2.0f, translatez); // perform transformations
// draw our smooth shaded triangle
glBegin(GL_TRIANGLES);
glColor3f(1.0f, 0.0f, 0.0f); // red vertex
glVertex3f(-1.0f, -1.0f, -.5f);
glColor3f(0.0f, 1.0f, 0.0f); // green vertex
glVertex3f(2.0f, -1.0f, -.5f);
glColor3f(0.0f, 0.0f, 1.0f); // blue vertex
glVertex3f(-1.0f, 2.0f, -.5f);
glEnd();
myRobot.DrawRobot();
glMatrixMode(GL_PROJECTION); // set projection matrix current matrix
glLoadIdentity(); // reset projection matrix
glOrtho(0.0f, width - 1.0, 0.0, height - 1.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW); // set modelview matrix
glLoadIdentity(); // reset modelview matrix
glRasterPos2i(200,200);
glDrawPixels(bitmapData->sizeX, bitmapData->sizeY, GL_RGB, GL_UNSIGNED_BYTE, bitmapData->data);
glFlush();
SwapBuffers(g_HDC); // bring backbuffer to foreground
}