Skip to content

Frequently Asked Questions

Charles William King edited this page May 31, 2024 · 6 revisions

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.

General

Is Allegro C or C++?

With the exception of a few DirectX files that are required to be C++, Allegro is programmed according to the C90 standard.

Is Allegro compatible with C++? Is it compatible with C?

Yes and yes. Also, thank you for finding the answer to your question here, in the FAQ. You are off to a good start.

Is Allegro compatible with non-C language X?

Maybe.

Is Allegro thread-safe?

Yes.

Which branch/version of Allegro should I use?

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.

Installation

See here.

Program Compilation

Why do I get undefined symbol errors?

Because you aren't linking correctly to Allegro. Try adding the -lallegro switch to your compile command. Add an additional -lallegro_main for Mac.

How do I statically link?

Sacrifice a virgin maiden to the gods of Mt Allegrohorn.

How do I build an executable that runs on any Linux distro?

Link to and distribute monolithic Allegro builds for both 64- and 32-bit platforms.

Programming

Why does Allegro register too many key/mouse presses?

Because you're not using events.

How do I switch between full-screen and windowed modes?

For full-screen, use ALLEGRO_FULLSCREEN_WINDOWED and scale the buffer with a transformation.

For windowed, use ALLEGRO_WINDOWED.

How do I open GIF animations?

Use algif.

Should I use memory or video bitmaps?

The answer is not entirely straightforward, but here are some facts:

How do I prevent the task bar from appearing on top of a full-screen display?

See here.

How do I create a multi-threaded application?

See here.

How do I use Allegro with a UI engine like Awesomium?

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.

Clone this wiki locally