-2
我在互联网上尝试了很多方法,但仍然无法正常工作。 现在我想如果麻烦与我的操作系统(Ubuntu的)有关。上述linux openGL depth_test不能正常工作
void init(void){
glClearColor(1.0, 1.0, 1.0, 0.0);
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glClearDepth(1.0);
glDepthFunc(GL_LESS);
glFrontFace(GL_CCW);
glCullFace(GL_BACK);
glEnable(GL_CULL_FACE);
init2();
}
void reshape(int w, int h){
int t = min (w,h);
glViewport (0, 0, t, t);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-100.0, 100.0, -100.0, 100.0, 1.1, 200.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(40.0, 40.0, 100.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
}
两个功能是从我的代码..
当你创建gl_window_时,你实际上是否需要一个深度缓冲区? – derhass