Depth Buffer and OS X

I an using an NSOpenGL view in OS X and drawing works perfectly except, it appears as though the Depth Buffer is not there, and I really mean NOT THERE.

I call glEndable(GL_DEPTH_TEST), however, objects are displayed in front of each other based on their draw order.

I have gone so far as to setup my own pixel format setting NSOpenGLPFADepthSize = 32 bits and re-initializing the NSOpenGLContext with my pixel format. This seems to have to affect.

Do I need to set something with the NSOpenGLContext? and if so, what and how?

Nobody

Find my problem in a post back on 05-12-2000. I was setting up my pixel format wrong!

for some reason when I read the docs on how to set the pixel format attributes, I thought every attribute had to have a corresponding value. Wich is WRONG. The boolean attributes only need to be put in the attribute list.

so basically:
NSOpenGLPixelFormatAttribute attribs[] = {NSOpenGLPFAAllRenderers,NSOpenGLPFADoubleBuffer,GL_FALSE,NSOpenGLPFADepthSize,32,0};
is WRONG!

and:
NSOpenGLPixelFormatAttribute attribs[] = {NSOpenGLPFAAllRenderers,NSOpenGLPFADepthSize,32,0};
is CORRECT!
Works great now!

Find my problem in a post back on 05-12-2000. I was setting up my pixel format wrong!

for some reason when I read the docs on how to set the pixel format attributes, I thought every attribute had to have a corresponding value. Wich is WRONG. The boolean attributes only need to be put in the attribute list.

so basically:
NSOpenGLPixelFormatAttribute attribs[] = {NSOpenGLPFAAllRenderers,NSOpenGLPFADoubleBuffer,GL_FALSE,NSOpenGLPFADepthSize,32,0};
is WRONG!

and:
NSOpenGLPixelFormatAttribute attribs[] = {NSOpenGLPFAAllRenderers,NSOpenGLPFADepthSize,32,0};
is CORRECT!
Works great now!

How did you get OpenGL anyway? If you worked at Apple, you wouldn’t need to post the question, and Mac OS X is only in alpha release

mac os x has been in beta for a long while now. mac os x dp4 has been out for a few months. and mac os x Public beta is coming out sept. 13th
in dp4 you have access to opengl.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.