Ok, I''m trying to create a small game from my own.. starting from 0 (not using Nehe basecode)... all is done and when I run it, it jsut show a black screen (suposed to show a quad).. the code is long but I will try to paste what you need to know to help me find what''s wrong!
in the main loop :
switch(STATE)
{
[...]
case STATE_MENU:
{
Racer.Messages();
Racer.Menu();
Racer.CheckKeys();
} break;
[...]
}
And yes the loop always get there...
void Racer::Messages()
{
MSG msg;
while(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
void Racer::Menu()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glColor3f(1.0f,0.0f,0.0f);
glTranslatef(0.0f,0.0f,-6.0f);
glBegin(GL_QUADS);
glVertex3f(-1.0, 1.0, 0.0);
glVertex3f( 1.0, 1.0, 0.0);
glVertex3f( 1.0,-1.0, 0.0);
glVertex3f(-1.0,-1.0, 0.0);
glEnd();
}
void Racer::CheckKeys()
{
switch(STATE)
{
case STATE_MENU:
{
if (keys[VK_ESCAPE])
{
STATE = STATE_SHUTDOWN;
}
} break;
}
}
humm if you need the Init section I will paste it but it''s long.... but I think it''s working great, I ChangeDisplaySettings, Create a window, GetDc, Choose/Set the PixelFormat, wglCreateContext, wglMakeCurrent, etc... And I get a black window fullscreen ready for OpenGL!
Thx if you can help me!