[cairo] Complete, simple example for EGL

Ngoc Dao ngocdaothanh at gmail.com
Sun Jan 27 05:18:23 PST 2013


Hi Cairo developers,

I'm investigating the way to use Cairo with OpenGL on Android.
As I understand, OpenGL ES 2 with EGL must be used.

The only example I can find so far is gl-surface-source.c
in the test directory of Cairo source code.
But that's not clear for a beginner like me to know how to use.
Can someone show me a complete, simple example?

Here's my current code so far. It doesn't show anything (I'm using
Cairo 1.12.2).
https://gist.github.com/4648313

Another thing. Why does cairo_egl_device_create call
eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)
?

Do I have to call:
context = eglCreateContext(display, config, EGL_NO_CONTEXT,
eglCreateContextattribs))
again after calling cairo_egl_device_create?

Thanks,
Ngoc


More information about the cairo mailing list