Only glsl shader version 120 works on mac OS X

匿名 (未验证) 提交于 2019-12-03 08:28:06

问题:

I have a problem with the glsl's version on my mac os X 10.9.2. I'm making a program in c++ with OpenGL and SDL2

I can't upgrade from my version 120 to any version higher. How I can upgrade please ? I compile like this :

g++ and my flag is : -framework SDL2 -lSDLmain -framework OpenGL -framework SDL2_image -framework cocoa

ERROR: 0:3: '' : version '330' is not supported

回答1:

On OS/X 10.9 to create an OpenGL 3.3/4.1 context you need to add the following snippet before SDL_CreateWindow.

A full example is available here: https://gist.github.com/mortennobel/643e92bd6a63de688c6f



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!