09.11.2012 Views

Contents - Raspberry PI Community Projects

Contents - Raspberry PI Community Projects

Contents - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

egistry/egl/specs/eglspec.1.4.20110406.pdf) and the following EGL extensions (links are<br />

to EGL registry documentation): [2]<br />

▪ EGL_KHR_image (http://www.khronos.org/registry/egl/extensions/KHR/<br />

EGL_KHR_image.txt)<br />

▪ EGL_KHR_image_base (http://www.khronos.org/registry/egl/extensions/KHR/<br />

EGL_KHR_image_base.txt)<br />

▪ EGL_KHR_image_pixmap (http://www.khronos.org/registry/egl/extensions/<br />

KHR/EGL_KHR_image_pixmap.txt)<br />

▪ EGL_KHR_vg_parent_image (http://www.khronos.org/registry/egl/extensions/<br />

KHR/EGL_KHR_vg_parent_image.txt)<br />

▪ EGL_KHR_gl_texture_2D_image (http://www.khronos.org/registry/egl/<br />

extensions/KHR/EGL_KHR_gl_image.txt)<br />

▪ EGL_KHR_gl_texture_cubemap_image (http://www.khronos.org/registry/egl/<br />

extensions/KHR/EGL_KHR_gl_image.txt)<br />

▪ EGL_KHR_lock_surface (http://www.khronos.org/registry/egl/extensions/KHR/<br />

EGL_KHR_lock_surface.txt)<br />

Creating an on-screen EGL rendering surface requires you to to use the<br />

eglCreateWindowSurface function, which takes a EGLNativeWindowType parameter. On<br />

the <strong>Raspberry</strong> Pi, this is implemented as a EGL_DISPMANX_WINDOW_T struct,<br />

which is defined in eglplatform.h as:<br />

typedef struct {<br />

DISPMANX_ELEMENT_HANDLE_T element;<br />

int width; /* This is necessary because dispmanx elements are not queriable. */<br />

int height;<br />

} EGL_DISPMANX_WINDOW_T;<br />

Therefore, to create a EGL surface you must also use the Dispmanx library to get a<br />

dispmanx element handle. The hello_triangle source code (https://github.com/<br />

raspberrypi/firmware/blob/master/opt/vc/src/hello_pi/hello_triangle/<br />

triangle.c#L147-173) provides example code to do this.<br />

Samples<br />

See Getting Started with EGL (http://jonmacey.blogspot.com.au/2012/05/getting-startedwith-egl-on-raspberry.html)<br />

post by Jon Macey. Extended documentation available in the<br />

EGL Version 1.4 Specification (http://www.khronos.org/registry/egl/specs/<br />

eglspec.1.4.20110406.pdf) and Simple Reference available in the EGL 1.4 A<strong>PI</strong> Quick<br />

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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!