OpenGL ES和OpenGL有什么区别?


Answers:


13

OpenGL ES (Embedded Systems) is a stripped down version of OpenGL. There are a lot of differences between those two and if you want to go way into the details, then you can read this 128 specification paper. But ES is a subset of OpenGL so all ES apps work on non ES systems but not the opposite.

There is no one place where you can easily define what is in ES and what is not. Even one definition is "OpenGL-ES is just like OpenGL, but without a lot of stuff. For example, there's no glBegin or glEnd."


5
ES isn't a straight subset of OpenGL, so your claim that all ES apps work on non ES systems isn't true.
Jari Komppa

5
@JariKomppa - It is as of OpenGL 4.1.
DMan

A nice summary of the changes / difference would be nice.
bobobobo

19

Alas, not one of the answers so far is both complete and fully correct. Really, OpenGL-ES does two things OpenGL does not:

1) it strips down and then extends OpenGL APIs to make it suitable for a mobile platform. That is, first they strip out APIs and features you really don't need, and are burdensome for mobile implementations, such as rendering polygons or using display lists. Then it makes a few judicious extensions to make it more useful for the mobile platform. I can't even remember an example of this, though.

2) it provides the interface to the window manager (and therefore native graphics hardware) of the mobile platform. This part of OpenGL-ES, known as EGL, is a lot like GLUT on the desktop. Except that it has none of those convenience methods that are not strictly necessary for that interface. So there is no API for drawing polyhedra or spheres (like in GLUT). But there are, for example, APIs that correspond to GLUT's init(), and to DisplayFunc() and ReshapeFunc() callbacks.


2
EGL is not part of OpenGL ES. It's it's own separate thing. See the spec. It is not a required part of OpenGL ES and is barely mentioned except to say that it might exists on your system but otherwise setting up a window etc is outside the scope of the OpenGL ES spec
gman

7

There is two OpenGL ES versions available on Android:

  • OpenGL ES 1.x (1.0 or 1.1): a subset of OpenGL 1.5 without immediate commands
    • no glBegin/glEnd
    • no Quad or Polygon support
  • OpenGL ES 2.0: a subset of OpenGL 3.X without fixed pipeline
    • vertex shaders
    • fragment shaders
    • geometry shaders are not available

Warning, OpenGL ES 2.0 is not compatible with OpenGL ES 1.X!

Almost all Android phones have OpenGL 1.X GPU and most have 2.0. OpenGL ES 2.0 is only available with Android 2.x or newer.

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.