Ah well I somehow screwed up my depth buffer somehow and I don't know how I did it and even worse, how to reverse it. What the problem is that I can't have any value outside the range 1 to -1 if I want it to show. If z goes outside that range the vertexes won't be rendered.
Here's my test code:
// aRenderer just wraps gl* commands.
aRenderer.PushModelView();
aRenderer.LoadModelView();
aRenderer.Translate( 0, 0, -2 ); // Won't show anything!
aRenderer.StartPrimitive( Graphics::Renderer::QuadPrimitive );
aRenderer.AddVertex( 0, 0, 0 );
aRenderer.AddVertex( 1, 0, 0 );
aRenderer.AddVertex( 1, 1, 0 );
aRenderer.AddVertex( 0, 1, 0 );
aRenderer.EndPrimitive();
aRenderer.PopModelView();
Also tried without pushing the matrix, still same effect.
My Init function:
// Setup some basic opengl.
glClearColor( 0.f, 0.f, 0.f, 0.f );
glEnable( GL_DEPTH_TEST );
glDepthFunc( GL_LEQUAL );
glDepthMask( GL_TRUE );
glClearDepth( 1.f );
//glCullFace( GL_BACK );
float width = static_cast< float >( myContext->GetWidth() );
float height = static_cast< float >( myContext->GetHeight() );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective( 90, width/height , 1, 500 );