I'm starting to play with OpenGL and I'd like to avoid the fixed functions as much as possible as the trend seems to be away from them. However, my graphics card is old and only supports up to OpenGL 2.1. Is there a way to wr开发者_JAVA技巧ite shaders for GLSL 1.20.8 and then run them without issue on OpenGL 3.0 and OpenGL 4.0 cards? Perhaps something when requesting the opengl context where you can specify a version?
I should use the #version directive.
精彩评论