I am using wxGLContext and wxGLCanvas for 3D visualization. I initialized opengl like this
SetCurrent(*canvas);
glEnable(GL_BLEND);
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
and draw the objects
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-w, w, -h, h, -10.0f, 10.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
quad = gluNewQuadric();
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL);
//draw the objects
gluDeleteQuadric(quad);
glFlush();
The problem is that this code works fine in windows, but in ubuntu the objects clipped by the objects which are located in back. The glFrontFace is correct for all objects, but clipping is wrong.