|
Allegro 5 on RPi - All working, but some questions |
Kev Callahan
Member #6,022
July 2005
|
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 |
Thomas Fjellstrom
Member #476
June 2000
|
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. -- |
Kev Callahan
Member #6,022
July 2005
|
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(!). |
Thomas Fjellstrom
Member #476
June 2000
|
Kev Callahan said: 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. -- |
Trent Gamblin
Member #261
April 2000
|
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?
|
Kev Callahan
Member #6,022
July 2005
|
My understanding is that OPENGL(ES) is all that's available on the rPi (hardware accelerated)? |
Trent Gamblin
Member #261
April 2000
|
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.
|
Kev Callahan
Member #6,022
July 2005
|
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). eg - Could this be done just using the A5 API..? |
Trent Gamblin
Member #261
April 2000
|
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.
|
Kev Callahan
Member #6,022
July 2005
|
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. |
Thomas Fjellstrom
Member #476
June 2000
|
Kev Callahan said: 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. -- |
pkrcel
Member #14,001
February 2012
|
Someone even made some decent 3D in the latest speedhack It is unlikely that Google shares your distaste for capitalism. - Derezo |
Kev Callahan
Member #6,022
July 2005
|
Ah great, thanks everyone; will look into that then. |
|