PDA

View Full Version : OpenGL ES & OpenVG using the same EGL implementation



ajay
07-18-2008, 05:49 AM
Hi Group

I have two Queries :

1) I would like to know whether the Redering API's (OpenGLES and OPENVG) can render to the same surface ...in other words ...whether the below sequence will work :

########################################3
//initialize EGL
eglBindAPI(EGL_OPENVG_API);
egldisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
eglInitialize(egldisplay, NULL, NULL);
eglChooseConfig(egldisplay, s_configAttribs, &eglconfig, 1, &numconfigs);
eglsurface = eglCreateWindowSurface(egldisplay, eglconfig, (void*)window, NULL);
eglcontext = eglCreateContext(egldisplay, eglconfig, NULL, NULL);
eglMakeCurrent(egldisplay, eglsurface, eglsurface, eglcontext);

// Some VG CALLS OF THE APPLICATION
-----
-----
-----

//De Associating the context

eglMakeCurrent(egldisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);

//Calling the EGL BIND API for binding OpenGl ES rendering API's calls

eglBindAPI(EGL OPENGL ES API);
eglcontext = eglCreateContext(egldisplay, eglconfig, NULL, NULL);
eglMakeCurrent(egldisplay, eglsurface, eglsurface, eglcontext);

// Again call OPENGLES API calls by app

-------------
-------------

#############################################

2) Is there an OpenGLES and OpenVG software implementation with a single EGL for bind to both of them ?

Thanks in Advance.

Regards
Ajay.V

Xmas
07-18-2008, 06:11 AM
1) I would like to know whether the Redering API's (OpenGLES and OPENVG) can render to the same surface
Yes, provided the implementation exposes a config that has both EGL_OPENGL_ES_BIT and EGL_OPENVG_BIT set in EGL_RENDERABLE_TYPE.

ajay
07-21-2008, 05:56 AM
Thanks for your reply.

I understand from the EGL specs that EGL_RENDERABLE_TYPE is present from the EGL 1.2 version only.
Also from EGL 1.2 onwards the eglBindApi() was included.


Is there any possibilty/way to achieve the same (OpenGL ES & OpenVG using the same EGL implementation) in the EGL 1.1 by any chance ?
That is: Can Open GLES and Open VG render on the same EGL surface ?

Xmas
07-21-2008, 06:09 AM
EGL 1.1 does not support OpenVG as client API, so that can't work. It needs to be at least EGL 1.2 and the implementation needs to provide a suitable config.