Hey all.
I had a console system for the beginnings of my engine nicely done when I was rendering a Quake 3 Model.
However, when it comes to putting my console onto the the BSP Loader, it falls apart and does not display. This happened ages ago when I tried it before.
I'm using the BSP Loader tutorial from GameTutorials. I have not changed any of the code bar the CQuake3BSP class name (and that was to stay within the engines naming scheme. Its now CBSPX). Oh and changed Main.CPP/H to Entry.CPP/H to keep it constant for me.
My console window uses the ortho view to display stuff.
I am wondering what I need to alter in the RenderLevel() function. Currently my Console window does the following to get into Ortho and out:
Shifting into Ortho
CConsole::Shift_2D()
{
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(Left,Right,Bottom,Top,Near,Far);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
Rendering
glEnable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
Shift_2D();
//Load the texture:
glColor3f(1.0, 1.0, 1.0);
glDisable(GL_DEPTH_TEST);
// Bind the consoles texture to the following verts
glBindTexture(GL_TEXTURE_2D, l_Texture[0]);
glBegin(GL_QUADS);
// Display the top left point of the 2D image
glTexCoord2f(0.0f, 1.0f); glVertex2f(X, Y);
// Display the bottom left point of the 2D image
glTexCoord2f(0.0f, 0.0f); glVertex2f(0, Height);
// Display the bottom right point of the 2D image
glTexCoord2f(1.0f, 0.0f); glVertex2f(Width, Height);
// Display the top right point of the 2D image
glTexCoord2f(1.0f, 1.0f); glVertex2f(Width, 0);
// Stop drawing
glEnd();
[... Other console based code ...]
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
Shift_3D();
}
Shifting back into 3D
void CConsole::Shift_3D()
{
glMatrixMode( GL_PROJECTION );
glPopMatrix();
glMatrixMode( GL_MODELVIEW );
}
Now, I haven't any idea whats going wrong. When I tried this in my model viewer it works happily, but as I said, when I run it in the BSP loader...it rectals majorly.
Also, the same can be said for texture based fonts (Chptr 17, i believe, of Nehe). Anything that uses 2D ortho quads seems to refuse to display
Any hints?
I have been struggling with this for a while now trying to work out wtf is going wrong.
Cheers, any help is much appreciated and explanation is very very much appreciated :)