[SOLVED] OpenGL 3.2 / SDL 1.3 with OS X Lion |
OpenGL 3.2 / SDL 1.3 with OS X Lion |
nodag
|
I think it's highly likely that SDL 1.3 does not properly 'support' Lion at the moment. To activate the core profile in Lion one has to call some CGL functions defined in OpenGL.h which is probably not the case right now. I'm looking forward to it, though, and hope that it is properly include as soon as possible.
|
|||||||||||
|
OpenGL 3.2 / SDL 1.3 with OS X Lion |
Boouh
|
Is there any news ?
|
|||||||||||
|
Boouh
|
Good new the problem is resolved ! :D
I just found the solution by using Cocoa to create an OpenGL 3.2 context. I have noticed that with Cocoa, we were obliged to use Vertex Array Objects (VAO) and Vertex Buffer Objects (VBO) to draw something on the screen. I tried to use them with SDL Framework and it didn't work at first. In fact, the SDL (for Mac) doesn't handle few attributes properly. We need to use two attributes to enable the 3.2 profile : SDL_GL_CONTEXT_MAJOR_VERSION and SDL_GL_CONTEXT_MINOR_VERSION. To use them, I added this code in the SDL code (file : src/video/cocoa/SDL_cocoaopengl.m, function : SDL_GLContext Cocoa_GL_CreateContext(_THIS, SDL_Window * window)) :
I don't know how to submit a patch to SDL repository but this code enables Mac Users to use OpenGL 3.2 with SDL (Don't forget to use VAO and VBO in your code). |
|||||||||||||
|
cleure
|
Your patch will likely break on all other versions of OSX. You need to wrap the "if (_this...)" code inside of an "#ifdef MAC_OS_X_VERSION_10_7", because the constants used aren't available in older versions of OSX.
I've been working on getting SDL 1.3 + OpenGL 3.2 working in Lion in my spare time for the past week, and unfortunately it seems that is just one of the road blocks preventing SDL 1.3 from working properly with OpenGL 3.2. My OpenGL test code works in the native API, but completely breaks with SDL. |
|||||||||||
|