PDA

View Full Version : OpenGL versions / Extensions under MacOSX



Groovounet
09-26-2007, 02:24 AM
I would like to use VBOs with my program under MacOS ...

Unfortunalty it result in a segfault or something, the program just stop:
#0 0x06abbc50 in ?? ()
#1 0x208cad44 in gleDrawArraysOrElements_Core ()
#2 0x20924088 in gleDrawArraysOrElements_VBO_Exec ()

I haven't setup anything neither used GLEW, can't I VBOs by default ? Which version of OpenGL is supported by MacOSX ?

OneSadCookie
09-26-2007, 08:07 PM
Obviously, you need to check for the extension before you use it.

Since Mac OS X 10.4.3, VBOs are supported on all hardware.

You have some other bug.

Groovounet
09-28-2007, 04:12 AM
I finally figure out that I had a lot of issues...
I tryed to render just clear the color buffer and it doesn't work at all...

The point is I am actually do the OpenGL rendering in a separate thread, dedicated to it. But the windows remain created in the main thread. If I create a context on the main thread, I am able to render into it but it is obviously what I don't want to do.

When I try to render from the draw thread, the windows remains in white... I create the context from this thread and it thread perfecting ok.

I am wondering if the issue come from the swap buffer operation and the way I initialize the surface and the context before a use ?

In which thread am I suppose to call aglSwapBuffers, aglSetDrawable, aglSetCurrentContext ? My main or my draw thread ?

Cheers

Groovounet
09-28-2007, 04:23 AM
I forgot to say that I use AGL_BUFFER_RECT, I'am not sure as well where I should enable it, if it work on the current OpenGL context or the current Drawable or anything else...

OneSadCookie
09-29-2007, 04:12 AM
OpenGL contexts are current to a particular thread. You must make the appropriate context current in the appropriate thread before you render to it.

OpenGL contexts are not thread-safe. You may only use each context from a single thread at a time. Use mutexes or CGLLockContext to ensure this.

These rules are not specific to Mac OS X.

Groovounet
10-01-2007, 02:11 AM
I am already aware about these rules and I have applyed them on Windows and applied them the same way on MacOS... Unfortunatly, behind contexts, I mean on the AGL or Carbon side it should have some differencies.

Do you know anything about AGL_BUFFER_RECT or AGLDrawable that may my windows being white?