Outdated: somebody should sift through and update this where needed - eg. Allegro on C90 is dubious. Remove this block when done.
Every question on this page has really, truly been asked frequently.
With the exception of a few DirectX files that are required to be C++, Allegro is programmed according to the C90 standard.
Yes and yes. Also, thank you for finding the answer to your question here, in the FAQ. You are off to a good start.
If you have just started learning C/C++, use whichever branch is easiest to install on your system. If you have C/C++ experience and want to see what the Allegro API has to offer, use the work-in-progress branch. If you formerly programmed in Allegro 4, spend an afternoon bringing yourself up to speed with the Allegro 5 API and use the work-in-progress branch.
Because you aren't linking correctly to Allegro. Try adding the
-lallegro switch to your compile command. Add an additional
-lallegro_main for Mac.
Sacrifice a virgin maiden to the gods of Mt Allegrohorn.
Link to and distribute monolithic Allegro builds for both 64- and 32-bit platforms.
- Allegro.cc forum posts by Elias in "Linking allegro statically" and by Arthur Kalliokoski and bamccaig in "How to compile for a release from linux for all linux platforms?"
Because you're not using events.
For full-screen, use ALLEGRO_FULLSCREEN_WINDOWED and scale the buffer with a transformation.
For windowed, use ALLEGRO_WINDOWED.
- Achieving Resolution Independence
- Allegro.cc forum post by Thomas Fjellstrom in "Fullscreen in Linux Mint"
The answer is not entirely straightforward, but here are some facts:
- Video bitmaps are generally faster than memory bitmaps.
- Converting bitmaps between memory and video is generally slow.
- Testing helps.
Attach a shader as necessary to convert the UI engine's pixel format to one compatible with Allegro. Copy the pixel data to a locked video bitmap. Unlock and draw the bitmap.