0
\$\begingroup\$

I want to use GLSL but keep my current OpenGL 1.1 setup. The thing is that can I use OpenGL 2.0 shaders on OpenGL 1.1 renders?

\$\endgroup\$
1
  • \$\begingroup\$ What do you mean by your "OpenGL 1.1 setup"? What parts of it do you want to keep? \$\endgroup\$ Feb 9, 2013 at 11:17

2 Answers 2

1
\$\begingroup\$

Until OpenGL 3.0, each version of OpenGL was a direct superset of the previous one, so as long as a graphics card and its drivers support the functions you use, you don't have to worry about compatibility. Also, until 3.0 was released, there was no way to choose an OpenGL version because if you got a newer version than you wanted, you just got functionality you didn't use. You were just given whatever version your driver supported, and there was nothing lost.

So to answer your question, if your graphics card and drivers support OpenGL 2.0 functions and shaders, you can use them without worrying about any code that was designed for 1.1.

Now when OpenGL 3.0 was released, some functions were marked deprecated, and a mechanism to choose your OpenGL version was added. Then beginning with 3.1 some functions were removed. But many people were in situations like yours and still wanted the old functions, so beginning with 3.2 a compatibility profile was added with its own, separate specification.

So once you start upgrading past v3.0, then you have to worry about compatibility a little. In that case, I recommend looking at the specification for the specific version and profile you want to use. It will tell you what should be supported.

\$\endgroup\$
-3
\$\begingroup\$

If you are using OpenGL ES, no you can't, if you setup an opengl 1.1 context, all shaders & opengl 2.0 calls will fail. You must convert your setup to opengl 2.0. You can keep compatible function calls like glTexImage..., glDraw...etc. But all fixed functions like glTranslate, glMatrixMode(), etc... must be converted to your own matrix calculation mechanism.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ None of that is true; with "classic" (i.e. pre-3.x) GL you get all the functionality of whatever GL_VERSION is reported by your driver; there's no such thing as "set up a 1.1 context", and GL2.0 still retains e.g. the old matrix stacks. \$\endgroup\$ Feb 9, 2013 at 13:18
  • 1
    \$\begingroup\$ I think you got confused with OpenGL ES. Otherwise, this answer is completely wrong and doesn't make much sense. As mentioned, there's no such thing as a GL 1.1 context. \$\endgroup\$
    – 5ound
    Feb 9, 2013 at 20:31
  • \$\begingroup\$ Yes indeed, I was talking about OpenGL ES, sorry if I confused you i should have specified it. What I said stand for both iOS and Android as far as I know...I updated my post \$\endgroup\$ Feb 10, 2013 at 1:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .