Hi,
I've just started developing with Allegro 5 on the Raspberry Pi..
Great framerates so far and pleased with what's possible with HW acceleration enabled.
Is it worth trying to get OpenGLES bits working from within Allegro (something I haven't managed to get working yet - ie OPENGLES programs work or Allegro works - haven't figured out what needs to be setup to mix the two).
Kev
GL/GLES and Allegro are possible to use at the "same time". Allegro gfx apis assume they are in control of the GL state, so you may want to save state before changing things, then restore it before calling allegro drawing functions.
If you don't use any allegro drawing, and just use GL, like your own shaders, and VBOs, then just use GL as you see fit.
Ah thanks Thomas..
You are implying it's not a common thing to do then..?
Must admit the more I look at OpenGL(ES) the more I am shying away from using it - although what's possible from demos is making me think I need to read up more to understand the basics(!).
You are implying it's not a common thing to do then..?
It's quite common to treat Allegro5 as a window creation and event api, and use GL directly for drawing.
I guess you want to get OpenGL ES working instead of regular OpenGL? I'm not sure if there is any benefit but if there is that would be worthwhile. Could you elaborate maybe?
My understanding is that OPENGL(ES) is all that's available on the rPi (hardware accelerated)?
If not, I need to read more ..
Ok you're right, but I still don't understand your question. Allegro uses OpenGL ES on Pi, so if Allegro works OpenGL ES works too.
I was trying to access the opengles api as well as the Allegro api (and trying to figure out if it's worth looking at).
I've always preferred using Allegro but imagine there are things available via opengles direct that I can't do with Allegro..?
eg -
An example would be (say) the opengles spinning teapot with video mapped onto the surface: http://www.raspberrypi.org/documentation/usage/demos/hello-teapot.md
Could this be done just using the A5 API..?
If so then endeavouring to access the opengles layer are pointless (and that would be great).
You can draw in 3D with the primitives addon and Allegro 5 transformations. But there are some things you may need to access directly. I would look at ex_opengl in the A5 source which you should have compiled (unless they don't get compiled on RPi, and I can't remember.) Basically you just include OpenGL or OpenGL ES headers then use GL wherever you want. I think on RPi the OGL headers are:
#include <GLES/gl.h>
And you may need (but probably not):
#include <EGL/egl.h> #include <EGL/eglext.h>
Those headers I believe are located in /opt somewhere so you need to tell your compiler to use that directory (-I/opt/vc/include).
EDIT: allegro_opengl.h already includes the correct headers, so just include that. You'll still have to add the search path though.
Ah cheers Trent - will take a look at that.
I believe ex_opengl doesn't build (or can't be built - maybe I'll look at that code, but it probably I guess has OPENGL specific functions that aren't available in ES).
I will take a closer look at the Primitives addon - only currently used that for drawing rectangles, would it support 'mapping a texture onto a triangle' for example.
would it support 'mapping a texture onto a triangle' for example.
Yup. It can do a lot more than that if you work with the lower level stuff as well. And if you throw in shaders, you can do anything.
Someone even made some decent 3D in the latest speedhack
Ah great, thanks everyone; will look into that then.
I'd prefer not to start using opengl if I can help it - life's too short as it is