that’s the code where I’m drawing the model and the skybox, the skybox shows just fine but the ball appear only when I’m about to close the window:
void DrawGLScene(GLvoid)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
gluLookAt(movx, movy, movz, cx, cy, 0, -5, 1, 0);
/*skybox(30); */ //60
ball.pos.x = 0;
ball.pos.y =0;
ball.pos.z= 0;
ball.scale = 2;
ball.Draw();
glEnd();
...
and then in main:
int main(int argc, char* argv[]) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH);
glutInitWindowSize(1000, 800);
glutCreateWindow("Hello, GL");
glutReshapeFunc(changeViewPort);
glutDisplayFunc(render);
InitGL();
glutDisplayFunc(DrawGLScene);
glutKeyboardFunc(Keyboard);
glutSpecialFunc(special);
glutReshapeFunc(Reshape);
GLenum err = glewInit();
if (GLEW_OK != err) {
fprintf(stderr, "GLEW error");
return 1;
}
glutMainLoop();
return 0;
}
draw() is a model function I call in the drawglscene function, anyway I don’t think this is the problem because when I tried the same code using glut it worked just fine. and as I said above the model appears but only when I’m about to close the window