|
|
This thread is locked; no one can reply to it.
|
1
2
|
| Allegro 5 and Raspberry Pi |
|
Eric Johnson
Member #14,841
January 2013
|
Hi there. I have recently purchased a Raspberry Pi Model B, and I am interested in creating games for the tiny device. I already know how to create games using Allegro 5, so that's no worry, but will this work on Raspbian? Meaning, will I be able to create and compile C++ code using Allegro 5 on this OS? Thank you for your time.
|
|
Indeterminatus
Member #737
November 2000
|
I don't know if anyone has tried yet. If not, be the first _______________________________ |
|
Eric Johnson
Member #14,841
January 2013
|
Aah, a potential challenge then. Thanks for the reply.
|
|
Hard Rock
Member #1,547
September 2001
|
Trent over at http://www.nooskewl.com/ has ported his game using allegro to the Raspberry Pi. The game is now open source and he already made several fixes to allegro to get it to work if I'm not mistaken. _________________________________________________ |
|
Trent Gamblin
Member #261
April 2000
|
Yeah, Allegro 5.1 in git has a Raspberry Pi port. There are build instructions in README_raspberrypi.txt. From a users perspective it's pretty much the same as writing for any other OS. The only difference is whatever you pass to al_create_display will be scaled to native resolution (so you should probably pass native resolution) and the keyboard driver at the console (not in X) is laggy/unusable. Looking for a fix for that..
|
|
Eric Johnson
Member #14,841
January 2013
|
Trent Gamblin, thank you for the post. What does this mean exactly, will I not be able to use keyboard inputs to power my game on the Pi?
|
|
Trent Gamblin
Member #261
April 2000
|
In X the keyboard driver works well. If you exit X to the command line then the keyboard driver doesn't work so well. There's a bug report open on it. I dunno if I can look at fixing it right now but it's on my list. Maybe since you're going to be one of the first to use the port I can make some time for it this weekend
|
|
Eric Johnson
Member #14,841
January 2013
|
Oh I see. Are you the main guy behind the Pi port?
|
|
Trent Gamblin
Member #261
April 2000
|
I guess so, I'm the one who initially made the port anyway. It needs some testers making games for it, I think I'm the only one to port a game to it fully. I'll try to get around to the keyboard driver soon as it would benefit my game(s) too.
|
|
Eric Johnson
Member #14,841
January 2013
|
Wow, that's actually pretty cool; good on you. Have you tried USB controllers or joysticks with the RPi and Allegro before? The reason I ask is because I want to use a USB controller to play games on my RPi. However, if keyboards may sometimes be an issue with Allegro on the RPi, it would stand to reason that the controller could too.
|
|
Trent Gamblin
Member #261
April 2000
|
Controllers work fine, or at least mine does. I just had a look at the keyboard driver and found the bug. Seems it was a case of search and replace gone wrong. We used to have an ALLEGRO_EVENT_KEY_REPEAT, but that was replaced by ...KEY_CHAR. IIRC REPEAT didn't fire on the first press of the key, but CHAR is supposed to. So the code just hadn't been updated, because the RPi port is the first A5 platform to use it. I'll push a fix in just a few minutes.
|
|
Eric Johnson
Member #14,841
January 2013
|
I'll take full advantage of my controllers now. And you fixed it; great going! I can't wait to get my Pi and make some games on it.
|
|
_Kronk_
Member #12,347
November 2010
|
This is actually really cool. Nice work Trent! Now I have something cool to do with a Pi if I ever get one -------------------------------------------------- My blog: http://joshuadover.tumblr.com |
|
Eric Johnson
Member #14,841
January 2013
|
Long time no see, right guys? Does anyone have a link to where I could download Allegro 5 for RPi?
|
|
Peter Wang
Member #23
April 2000
|
Build it from git or the 5.1.5 release (see the announcement on the Allegro Development thread)
|
|
Eric Johnson
Member #14,841
January 2013
|
Thank you very much. I downloaded the .zip file which includes Allegro 5. Would I just include the entire include folder like I would in any other IDE and it should work on RPi?
|
|
Thomas Fjellstrom
Member #476
June 2000
|
You'll need to build allegro yourself. Which means compiling it on the Raspberry Pi, or cross-compiling it on your computer. -- |
|
Eric Johnson
Member #14,841
January 2013
|
Thomas Fjellstrom, I have downloaded the 5.1.5 version (which has RPi support, supposedly) and plan on compiling it from my RPi. I'll let you all know how it goes later on, when I have more time. UPDATE fatal error: allegro5/platform/alplatf.h: No such file or directory.
|
|
Thomas Fjellstrom
Member #476
June 2000
|
I don't think you should use CodeBlocks to compile allegro. Instead, check out the readme file, and use CMake and make to build allegro from the command line. -- |
|
Eric Johnson
Member #14,841
January 2013
|
Oh okay. I'm brand new to this. Ha ha. Would you still recommend I use C::B to write the code? Can that be done; I write the files in C::B, but compile it through the command line? By the way, I read that I'm supposed to add some direct dependencies (from this page). How does that work? How would I do that with the command line? Like I said before, I'm a complete newbie.
|
|
Thomas Fjellstrom
Member #476
June 2000
|
Code::Blocks is fine to write your apps. But you should build allegro with the standard build tools. -- |
|
Eric Johnson
Member #14,841
January 2013
|
Hey again. I've been messing around with compiling C++ code using the command line alone. First off, allow me to demonstrate how I have been compiling code as of late. g++ -o testprogram /home/pi/Desktop/main.cpp Assuming that all went well, it could generate an executable on the Desktop called "testprogram". #include <allegro5/allegro.h> It would fail. So I thought that I should link to Allegro's full path... #include "/home/pi/Desktop/Games/allegro/include/allegro.h" Still, it would fail, because it says that it couldn't find one of the files in which allegro.h was including. I appreciate your assistance.
|
|
Trent Gamblin
Member #261
April 2000
|
Keep it as #include <allegro5/allegro.h>. Then on the command line to gcc add
|
|
Eric Johnson
Member #14,841
January 2013
|
Thank you for the reply. I'm getting closer! Alas, I still have some issues. Mainly, right now it is saying "allegro5/platform/alplatf.h: No such file or directory", then terminates the compilation. I see that alplatf.h.cmake exists, but not the .h file on its own. Should I simply rename it from alplatf.h.cmake to alplatf.h, it compiles further, but runs into issues. My question now is: what do I do with the alplatf.h.cmake file? How do I convert it to .h safely? Thank you! Update Thanks.
|
|
Trent Gamblin
Member #261
April 2000
|
Check your build directory where you ran cmake. You did run cmake right? It'll be in build/include/allegro5/platform/alplatf.h.
|
|
|
1
2
|