本文介绍了EGL VS GLES 2.0在Android上(例如,Java)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(有经验的C程序员,pre-着色器,固定功能的Open GL。主管Java程序员)

(experienced c programmer, pre-shader, fixed function open gl. competent Java programmer)

我一直在与GLES在Android和已经得到的例子来运行(包括本地和Java)。具体地,纹理化三角形的例子。什么是完全困惑我是Khronos的EGL和Android GLES接口的关系。

I have been working with GLES on Android and have gotten the examples to run (both native and Java). In particular, the textured triangle example. What is completely confusing me is the "relationship" of Khronos EGL and the android GLES interfaces.

难道这些平行的,独立的接口(API)?是EGL应该是一个独立于平台的(中性的)接口?EGL似乎完全支持GLES 1.0和1.1,但不支持ES 2.0(在Android)?

Are these parallel, independent interfaces (API)?Is EGL supposed to be a platform independent (neutral) interface?EGL appears to fully support GLES 1.0 and 1.1 but does not support ES 2.0 (on Android)?

所以,在我看来,EGL是应该是一个中立的平台,并行接口,它不完全支持的 GLES 2.0 (在Android);所以,如果你正在写GLES 2.0 code(在Android),您只需使用GLxxx API,而不是EGLxxx API(和不得不求助于GLxxx API反正)会更好。据我所知,你不>的<用EGL的任何东西,因为它仅支持ES 2.0 API的一个子集。

So, it appears to me that EGL is supposed to be a platform neutral, parallel interface, BUT it does not fully support GLES 2.0 (on Android); So if you're writing GLES 2.0 code (on Android), you are better off just using the GLxxx API rather than the EGLxxx API (and having to resort to the GLxxx API anyway). As far as I can tell, you don't >HAVE< to use EGL for anything since it only supports a subset of the ES 2.0 API.

(每个实例/电子书/引用或者混合了两下,使用本机接口或仅使用EGL 1.1功能;?我失去了一些东西根本此处)

(Every example/book/reference either mixes the two, uses the native interface or uses only EGL 1.1 features; Am I missing something fundamental here?)

推荐答案

EGL是一个补充的OpenGL ES。 EGL是用于获取表面渲染使用像eglCreateWindowSurface功能,然后你可以借鉴与OpenGL ES的那面。它的作用类似于GLX / WGL / CGL。

EGL is a complement to OpenGL ES. EGL is used for getting surfaces to render to using functions like eglCreateWindowSurface, and you can then draw to that surface with OpenGL ES. Its role is similar to GLX/WGL/CGL.

不管是不是EGL可以给你,支持OpenGL ES 2.0可以通过平台有所不同,但如果Android设备支持ES 2.0和EGL,你应该能够从EGL得到这样​​的上下文语境。看看在EGL_RENDERABLE_TYPE属性和EGL_OPENGL_ES2_BIT请求的EGLConfig时。

Whether or not EGL can give you a context that supports OpenGL ES 2.0 may vary by platform, but if the Android device supports ES 2.0 and EGL, you should be able to get such a context from EGL. Take a look at the EGL_RENDERABLE_TYPE attribute and the EGL_OPENGL_ES2_BIT when requesting an EGLConfig.

http://www.khronos.org/files/egl-1-4-quick-reference-card.pdf

这篇关于EGL VS GLES 2.0在Android上(例如,Java)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 07:53