fieldtensor
fieldtensor

Reputation: 4050

OpenGL vs OpenGL ES (GLchar and more)

I just caught a little quirk in my fledgling application's GL interfaces. On desktop GL things like glShaderSource() take a GLchar*, but on the mobile GLES interfaces they take a plain char*.

Now, this is really a very trivial thing to fix. Since GLchar is a typedef of char anyway, one can just use char* on desktop GL and be alright everywhere.

However, seeing this issue raises concerns in me about coming across other compatibility issues in the GL vs GLES realm. Of course I know that GLES 2.0 is basically a stripped down OpenGL 2.0, and that I'll have to suffer the loss of things like the fixed function pipeline. But will it get any worse that that? I was hoping that the interfaces which GLES 2.0 did leave for me would at least work identically to their desktop GL counterparts. But is this indeed the case? I sure do hope so.

Upvotes: 1

Views: 650

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 474326

But is this indeed the case?

No.

For example, glTexSubImage2D doesn't work in ES 2.0 like it does in desktop GL. The internal format and pixel format parameters take entirely different values, values that would not be legal in most cases with desktop GL.

You should not expect ES 2.0 code to run without changes on desktop GL.

Upvotes: 1

Related Questions