-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL2 OpenGL3 example not working on OSX 10.11.2 / Geforce 9400M #468
Comments
Issue was reported recently in #463 but not solved. I haven't personally tried this code on a Mac. Could you try: a/ the suggestions in that other thread? b/ disabling scissoring in the render function and see if it makes a difference? Otherwise have a look at whatever error reporting SDL2 offers, it may give a clue. The core profile version looks definitively wrong to me but the poster of the other thread said it didn't fix the issue. |
I have been able to solve the problem: Go to sdl_opengl3_example/main.cpp and replace this code: SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); With this: SDL_GL_SetAttribute (SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG);
SDL_GL_SetAttribute (SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); The problem with the original code was that an OpenGL context of version 2.2(a compability profile) was created. However, the shaders in So a core profile had to be created instead. However, you must be very careful when creating a core profile on mac. You have to set SDL_GL_CONTEXT_FLAGS to SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG and set SDL_GL_CONTEXT_PROFILE_MASK to SDL_GL_CONTEXT_PROFILE_CORE. Otherwise, it will fail. |
Thanks for looking into it |
Closing, thanks! |
The SDL + OpenGL 3 example app isn't working on OSX 10.11.2 on my Geforce 9400M. The SDL + OpenGL (compatibility) example app is working fine. (Using top of tree.)
The text was updated successfully, but these errors were encountered: