I’m writing a test program, with an OpenGL display. The result i’d like is this:
http://seb.sevilla.free.fr/opengl/test24bits.jpg
The problem is that I only got this result with 24 bits color, with 16 or 32 bits, I’ve got this:
http://seb.sevilla.free.fr/opengl/test16bits.jpg
Does anyone know the solution to my problem ? I use OpenGL with GLut under VC++, my OpenGL initialisation code :
GLview::GLview(int argc, char* argv[])
{
// glut-initialisations
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize(640,480);
WindowName = glutCreateWindow(“Test”);
glutReshapeFunc(Reshape);
glutDisplayFunc(Draw);
glutKeyboardFunc(Keyboardnorm);
glutSpecialFunc(keyboardspec);
float MatSpec[4] = {1.f,1.f,1.f,1.f};
float MatDif[4] = {.5f,.6f,.5f,1.f};
float MatAmb[4] = {.8f,.8f,.7f,1.f};
float LightDif[4] ={.7f,.7f,.7f,1.f};
float LightSpec[4]={.5f,.5f,.5f,1.f};
float LightAmb[4] ={.2f,.2f,.2f,1.f};
glShadeModel(GL_SMOOTH);
glDepthFunc(GL_LESS);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHT0);
glMatrixMode(GL_MODELVIEW);
glPointSize(3);
}