I am familiar with the basic differences between OpenGL and OpenGL ES, e.g. no glBegin, glEnd, no quads and so forth.
My question is therefore not about the differences between the two APIs but about writing code that can actually work on both APIs and their various implementations, especially regarding ES, where implementations seem to vary more.
Naturally, that means conforming to features that are both present in the two APIs and identical syntax, nothing too fancy and cutting edge, with OpenGL ES 2 being the lowest common denominator.
You may be interested in the new OpenGL ES compatibility extension ARB_ES2_compatibility (added to core in OpenGL 4.1)
Of course actually using the extension requires support for newer 4.1 desktop OpenGL but you can read through them and see what was required to get ES support on the desktop and avoid that in your ES code as much as possible. There may be some things that just aren't compatible with older desktop OpenGL versions though, mainly some shader stuff such as floating point precision.
There is also ARB_ES3_compatibility (core in OpenGL 4.3), but it's probably safe to ignore since it's for OpenGL ES 3.0).
According to Khronos OpenGL ES is a subset of desktop OpenGL, so to write compatible code you just need to use OpenGL ES documentation.
A quote from http://www.khronos.org/opengles/
OpenGL® ES is a royalty-free, cross-platform API for full-function 2D and 3D graphics on embedded systems - including consoles, phones, appliances and vehicles. It consists of well-defined subsets of desktop OpenGL
EDIT: As Justin Meiners pointed out in the comments there are actually some differences when it comes to the fine details. David C. Bishop's answer has more info on this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With