Reputation: 2351
Is it possible to mix OpenGL ES 1 and OpenGL ES 2 calls? Say you're using libraries that implemented some routines in OpenGL ES 1 and your existing code base is OpenGL ES 2. What would be a good way to go about doing this, suppose they are rendering in different render passes?
Upvotes: 1
Views: 1249
Reputation: 899
You can mix OpenGL ES 2.0 and OpenGL ES 1.1 in the same application but you cannot mix commands from the two different APIs with a single context binding. As soon as you issue an ES 1.1 only GL command on an ES 2.0 context binding or vice-versa your application will crash and it will not be obvious why it crash unless you're aware of this.
When contexts are created you must choose the API you're using and stick with it for every GL command issued when that context is bound.
So, as far as mixed use of the two APIs in one application, there is nothing preventing you from binding an ES 1.1 context on one thread and issuing nothing but ES 1.1 calls on that thread in the same application that you have an ES 2.0 context on another thread with nothing but ES 2.0 commands issued on that thread.
But as the gentlemen of Ghostbusters said: "Don't cross the streams!!".
Upvotes: 4
Reputation: 473232
OpenGL ES 2.0 is not backwards compatible with OpenGL ES 1.x. Pretty much by definition, this means that 2.0 isn't compatible with 1.x. For the most part.
Depending on the language and the binding to GL ES (which you didn't state), it's possible that you could recompile code that was written for ES 1.x for ES 2.0. Or that initializing ES 2.0 would cause all GL functions to be routed there. This means that if ES 1.x and 2.0 shared some function, then code that called that function would call whatever GL ES version was initialized. Again, you didn't say what language and how you were initializing it.
There are some functions in ES that work more or less the same from ES 1.1 and ES 2.0. I'd say that the texture initialization and setup didn't change much (you should read the specs to see how much changed). And the actual array drawing calls (glDrawArrays
, glDrawElements
) are more or less the same. And some of the core components like glViewport
, glDepthRangef
, and the like are the same.
But anything else (how vertex arrays are used, immediate mode, etc) is different and incompatible.
Upvotes: 4