Getting Started with EGL / OpenGL ES


14 posts
by jmacey » Thu May 31, 2012 1:12 pm
I've just started porting all my OpenGL library code http://nccastaff.bournemouth.ac.uk/jmacey/GraphicsLib/index.html to the pi, so I thought I would post here how I'm getting on. My first blog post is here http://jonmacey.blogspot.co.uk/2012/05/getting-started-with-egl-on-raspberry.html and I have a basic proof of concept of the whole library working here http://www.youtube.com/watch?v=lvnTG2hE-uM&feature=youtu.be

I will release the whole library asap, just getting round to tidying up the code in between my exam marking !

Jon

http://nccastaff.bournemouth.ac.uk/jmacey/
Posts: 135
Joined: Thu May 31, 2012 1:05 pm
by jmacey » Tue Jun 05, 2012 11:00 am
I've just added another post with some code to create and size an EGL window here http://jonmacey.blogspot.co.uk/2012/06/eglwindow-class.html I will do a full write up of the design and examples later in the week.
Posts: 135
Joined: Thu May 31, 2012 1:05 pm
by higwoth1 » Wed Jun 06, 2012 4:44 pm
This is good, cannot wait until you post some examples of moving textures around (I'd be happy with 2d at the moment).

Does EGL support 2d? Or is that VG? It's all very confusing.

Or does EGL just open up a 'display' (GLES or VG) and then GLES or VG code is used to do stuff?
Posts: 26
Joined: Sat May 26, 2012 1:27 am
by jmacey » Wed Jun 06, 2012 4:53 pm
At the moment I'm using it to Open up the display and create an OpenGL ES context and render some 3D stuff to it (I will post another demo soon just tidying up the code etc). EGL is a layer to allow both OpenGL (3D) and OpenVG (2D vector graphics) to draw to the hardware context. There is some info here http://www.khronos.org/egl/ and the full spec is here http://www.khronos.org/registry/egl/ you can think of it a bit like either glut or Qt on other platforms, however it's a lot lower level. My main focus at the moment is porting my NGL library to the pi so I can then port all of my 3D demos I use for teaching to it. You can see the main lib here http://nccastaff.bournemouth.ac.uk/jmacey/GraphicsLib/Demos/index.html
Posts: 135
Joined: Thu May 31, 2012 1:05 pm
by eppe » Fri Jun 08, 2012 10:56 am
Thank you for releasing your work.
I decided to give it a try but I am getting some strange compilation errors :
[code]test@raspbian:~/egl/EGL$ make
g++ -c -Wall -O3 -I/usr/local/include -I/opt/vc/include -Iinclude/ngl -Isrc/ngl -Isrc/shaders -DNGL_DEBUG EGLgetConfig.cpp -o EGLgetConfig.o
g++ -L/opt/vc/lib -lEGL ./EGLgetConfig.o -o EGLgetConfig
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_GetRenderbufferParameteriv'
/opt/vc/lib/libEGL.so: undefined reference to `gl20_client_state_init'
/opt/vc/lib/libEGL.so: undefined reference to `gl11_client_state_init'
/opt/vc/lib/libEGL.so: undefined reference to `glintAttribPointer'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_GenFramebuffers'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_buffer_info_get'
/opt/vc/lib/libEGL.so: undefined reference to `glDiscardFramebufferEXT'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_FramebufferTexture2D'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_IsRenderbuffer'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_set_error'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_BindFramebuffer'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_GenRenderbuffers'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_set_error_api'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_BindRenderbuffer'
/opt/vc/lib/libEGL.so: undefined reference to `glBufferSubData'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_GetFramebufferAttachmentParameteriv'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_CheckFramebufferStatus'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_FramebufferRenderbuffer'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_RenderbufferStorage'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_DeleteRenderbuffers'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_GenerateMipmap'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_buffer_info_set'
/opt/vc/lib/libEGL.so: undefined reference to `glPointSizePointerOES'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_DeleteFramebuffers'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_IsFramebuffer'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_state_free'
collect2: ld returned 1 exit status
make: *** [EGLgetConfig] Error 1
[/code]

Does someone have by any chance an idea of from where it comes ?

Thank you.
Posts: 18
Joined: Mon May 14, 2012 12:23 am
by jmacey » Fri Jun 08, 2012 11:04 am
On the latest kernel you need to add another include path for the pthreads. Not at the computer at the moment but if you look at the Makefile.include in /opt/vc directory with the demos you should see the new -I line you need. I've also added a new demo at the original link which should fix it. It's the same URL just put a 2 before the .tgz
Posts: 135
Joined: Thu May 31, 2012 1:05 pm
by eppe » Fri Jun 08, 2012 12:12 pm
Thank you for your quick answer jmacey, I now can have it to compile !
Posts: 18
Joined: Mon May 14, 2012 12:23 am
by CargoCult » Sun Jun 10, 2012 1:49 am
Thanks for this - I've been planning on learning me some OpenGL ES, and you've no doubt saved me loads of time in getting stuff to work!
Posts: 24
Joined: Wed Nov 02, 2011 7:06 am
by jmacey » Wed Jun 20, 2012 1:31 pm
Posts: 135
Joined: Thu May 31, 2012 1:05 pm
by Johnathon332 » Fri Aug 03, 2012 1:10 pm
Will you be releasing the library out in one package including the header files and cpp. At the moment I only have the EGLconfig cpp
Posts: 6
Joined: Thu Aug 02, 2012 10:26 pm
by jmacey » Sat Aug 04, 2012 8:07 am
The full source code can be found here http://nccastaff.bournemouth.ac.uk/jmac ... GLDemo.tgz also have a look at this for a lot more OpenGL / PI stuff

http://code.google.com/p/pingl/

Jon
Posts: 135
Joined: Thu May 31, 2012 1:05 pm
by Chinasaur » Mon Oct 08, 2012 4:04 am
eppe wrote:
Code: Select all
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_GetRenderbufferParameteriv'
/opt/vc/lib/libEGL.so: undefined reference to `gl20_client_state_init'
/opt/vc/lib/libEGL.so: undefined reference to `gl11_client_state_init'
/opt/vc/lib/libEGL.so: undefined reference to `glintAttribPointer'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_GenFramebuffers'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_buffer_info_get'
/opt/vc/lib/libEGL.so: undefined reference to `glDiscardFramebufferEXT'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_FramebufferTexture2D'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_IsRenderbuffer'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_set_error'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_BindFramebuffer'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_GenRenderbuffers'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_set_error_api'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_BindRenderbuffer'
/opt/vc/lib/libEGL.so: undefined reference to `glBufferSubData'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_GetFramebufferAttachmentParameteriv'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_CheckFramebufferStatus'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_FramebufferRenderbuffer'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_RenderbufferStorage'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_DeleteRenderbuffers'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_GenerateMipmap'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_buffer_info_set'
/opt/vc/lib/libEGL.so: undefined reference to `glPointSizePointerOES'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_DeleteFramebuffers'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_IsFramebuffer'
/opt/vc/lib/libEGL.so: undefined reference to `glxx_client_state_free'

Hey guys, sorry about this but I'm having the same set of link errors trying to compile Cairo with OpenVG/OpenGLES2 support. I'm a little mystified as to how adding an include directory at compile time is going to fix these link errors; can someone clear that up for me? In the meantime I'll try it and see what I get but rebuilding all my Cairo objects is going to take some time...
Posts: 113
Joined: Tue Sep 11, 2012 10:15 pm
by Chinasaur » Mon Oct 08, 2012 5:24 am
Okay, adding a link to GLESv2 seems to fix this, which makes a bit more sense. Not sure why Cairo was missing it.
Posts: 113
Joined: Tue Sep 11, 2012 10:15 pm
by jagoda » Sun Nov 11, 2012 12:49 pm
Thank you so very much for your hard work and enthusiasm ...
It will be of great help in putting together a little two day workshop on OpenGL ES aimed at teachers and adopters of the RasbperryPi ...
If you have any thoughts and ideas of how such a work shop might be "made excellent" I would really love to hear your thoughts and ideas.
Posts: 40
Joined: Fri Nov 02, 2012 8:46 am