Hi all,

I am trying to port an openGL ES application to use clutter and
cogl. The board that I am using has these specs: (note that clutter is
compiled with the eglnative backend)

ClutterEGL-Message: [BACKEND] 
clutter-1.2.4/clutter/eglnative/clutter-backend-egl.c:248: EGL surface is 
1280x720
ClutterEGL-Message: [BACKEND] 
clutter-1.2.4/clutter/eglnative/clutter-backend-egl.c:414: Checking features
GL_VENDOR: Intel Corporation
GL_RENDERER: Intel(R) GMA 500 based on PowerVR SGX 535
GL_VERSION: OpenGL ES 2.0
EGL_VENDOR: Intel Corporation
EGL_VERSION: 1.4 build 1.4.14.2514
EGL_EXTENSIONS: EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image 
                EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image 
                EGL_KHR_vg_parent_image EGL_INTEL_bind_pixmap 
EGL_IMG_context_priority

The client application uses "libgdl.h" and "libgma.h" to create a gdl
plane, and then that plane is passed like this:

  eglCreateWindowSurface(context->display, 
                         context->config,
                         (NativeWindowType)plane, 
                         NULL);
when creating the egl window surface.

A surface is then requested using
  gdl_alloc_surface

and mapped using
  gdl_map_surface
  gma_pixmap_alloc

and then the client draws to that gma_pixmap_t created with
gma_pixmap_alloc.

After the client draws to the surface, it passes the surface id to a
server application, and the server application then does the actual
drawing using openGLES. The server application takes the surface id
and does this:

  gdl_get_surface_info(appSurfaceId, &appSurfaceInfo);
  gdl_map_surface(appSurfaceId, &pixels, NULL);
  gma_pixmap_alloc(&pixmapInfo, &gma_pixmap_funcs, pPixmap);

  appSurface = eglCreatePixmapSurface(context->display, 
                                      context->config,
                                      appPixmap, 
                                      pixmapAttrs);

Once it has the appSurface it then uses openGL to draw like this:

  <pseudo code>

  glClear
  Identity
  Translate
  Scale

  </pseudo code>
  <real code>

  eglBindTexImage(context->display, appSurface, EGL_BACK_BUFFER);
  glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  eglReleaseTexImage(context->display, appSurface, EGL_BACK_BUFFER);
  eglSwapBuffers(context->display, context->fbSurface);

  </real code>

I have successfully ported the application to use clutter and it's
event based callbacks. But I notice that the clutter eglnative backend
creates its surface differently from how the openGL ES application
currently creates its egl context.

I would like to port the openGL drawing code to use cogl, but I am
unsure of where to start.

For starters, I notice that no where in the clutter or cogl codebase
are these calls:

eglCreatePixmapSurface
eglBindTexImage

ever used. So I'm not convinced that I'll be able to use cogl without
first changing the backend. Or is it possible that these calls:

eglCreatePixmapSurface
eglBindTexImage

can be replace with equivalents? 

Any help on where I should start?

thanks,
dave



      

-- 
To unsubscribe send a mail to [email protected]

Reply via email to