OpenGL versus OpenGL ES
OpenGL is a powerful, flexible API, initially designed for high-end workstations, but now suitable for PCs. Because it is an open standard contributed to by many leading entities in the graphics world, it was the natural choice when a common graphics API for embedded devices was needed.
However, OpenGL itself isn’t suitable for most embedded platforms. Modifications were needed to allow it to be used on low-power, relatively limited capability devices. This required many compromises, but in the end, the Khronos Group was able to deliver a specification that retained a great deal of OpenGL’s power while limiting the memory and processing requirements necessary for a compliant implementation. The changes made in creating OpenGL ES can be broken down into several main areas:
■ Removal of redundant APIs.
For the sake of flexibility, OpenGL includes many
different functions that do essentially the same thing. For instance, glColor()
comes in more than 30 different variations, each differing only in the number and OpenGL versus OpenGL ES 37 types of parameters. OpenGL ES removes many of these APIs, leaving behind the most common and general-purpose versions.
OpenGL的一些函数如glColor()根据不同参数又分成很多很多的函数。OpenGL ES删除了一些API,只留下最通用的那部分
■ Removal of redundant functionality.
OpenGL sometimes includes multiple ways
to do a single thing. For example, geometry can be specified using either immediate mode (i.e., glBegin()/glEnd()) or vertex arrays. In these cases, OpenGL ES retains the most efficient method and drops the rest.
OpenGL有时做同一个事情会有多种方法,比如geometry既可以通过immediate mode也可以通过vertex arrays来定义,OpenGL ES只保留了最有效的那种办法
■ Limitation of expensive features.
A lot of the functionality in OpenGL comes with a high implementation cost, especially for software-based solutions. In many cases, this can’t be avoided; texturing, for example, is expensive, but it would be difficult to promote OpenGL ES as a full-featured game API if it didn’t support texturing. There are, however, a number of expensive features that are useful but not strictly mandatory.
OpenGL ES either removes these features or makes them optional. For example,
OpenGL ES 1.0 implementations are required to support the APIs for multitexturing, but they do not have to support more than one texture unit. As OpenGL ES
evolves, it’s expected that some of these features will be made mandatory.
对一些资源消耗高的feature,限制性的支持:或者删除这些feature或者对这些feature是optional而不是强制的。当然像texturing还是要支持地~~。但对multitexturing的支持就仅限于one texture unit。
■ Removal of data types.
Since floating point operations are limited on even the most powerful embedded devices, double-precision floating point values have been removed from OpenGL ES. Because a number of OpenGL 1.3 functions only
accept doubles, these functions have been modified to accept single-precision
floating point numbers instead.
OpenGL ES不支持double-precision floating point values,对于那些仅接受double型的函数来说,OpenGL ES做出了修改,使他们接受ingle-precision floating point来代替
■ New versions of existing APIs supporting smaller data types.
Recognizing the
storage space and bandwidth limitations on embedded devices, OpenGL ES
defines several new APIs that accept smaller data types than those supported in OpenGL 1.3. For example, some functions that only accept integer or short values in OpenGL 1.3 will accept bytes in OpenGL ES 1.0.
OpenGL ES定义了一些新的API来接受更小的数据类型,如OpenGL仅接受int或short 类型但OpenGL ES的一些函数可以接受byte类型
■ Removal of the ability to retrieve dynamic state.
The ability to query any
OpenGL state at any time is useful but can be challenging to implement, especially
in multilayered systems. Since this ability was not considered critical, only the static state can be queried in OpenGL ES.
OpenGL可以在任何时候查询任何OpenGL状态,但OpenGL ES只能查询静态的状态
■ No GLU. The OpenGL Utility library contains quite a bit of helpful functionality,but the most useful functions it offers are simply wrappers on top of OpenGL.There is currently no specification available for an OpenGL ES version of GLU,although vendors are free to provide similar libraries.
OpenGL不支持GLU
■ New APIs supporting fixed point. Many embedded devices don’t include floating
point support in hardware. They may support pseudo-floats in software, but operations using them are typically quite slow. For this reason, OpenGL ES supports fixed point APIs and data types in the Common Lite subprofile.
有些嵌入式设备硬件不支持 floating point ,OpenGL ES 的一些新的API支持fixed point APIs and data types in the Common Lite subprofile