Allegro5 software

Can I use Allegro5 to fully software
render and not require OpenGL or DirectX to run app?

Matthew Leverton

Yes, if you don't need an ALLEGRO_DISPLAY.


Is there any fast method for send memory bitmap to window HDC?


Could I ask why you would not want to use the graphics card? Pretty much any computer from 2005 onward easily meets Allegro5's minimum requirements. Unless you are making a game that's pretty static like Solitaire, I highly recommend you give video bitmaps a try.

Also note that if you're planning to use the GDI specific HDC, why not simply use GDI+'s image drawing methods? I think you'll probably get similar speed as Allegro's software drawing routines.

It's difficult to tell without knowing what you're trying to do though.

Mark Oates

He may just be making a console app.


I have my app in Allegro5 and I use video bitmaps. But at now It must work on older machines, and I'd like to keep code without changes, or maybe with a few changes. The program do not render all the time, just when some objects change pos, size or image, so software renderer is a good way.

Thomas Fjellstrom

Allegro 5 depends on having some form of OpenGL 1.1+, or D3D 9 available. If you don't have either, it just won't work. So far there is no plan to include a software only display driver on any platform. OpenGL 1.1 was released in 1997. Many computers released after 1998 should have hardware capable of running a basic Allegro 5 program.

Mark Oates

Allegro 5 depends on having some form of OpenGL 1.1+, or D3D 9 available.

Really? I thought all the operations had software fallbacks.

Matthew Leverton
komons said:

Is there any fast method for send memory bitmap to window HDC?

I don't think A5 has any methods for that yet.

I thought all the operations had software fallbacks.

You can use memory bitmaps in a headless environment, but you cannot display them anywhere without an OpenGL or D3D window.

Trent Gamblin

I would be surprised if using memory bitmaps and GDI was not very slow by default. However, when the GP2X Wiz port was created, fast software blitters for RGB_565 and RGBA_4444 were added. Those were fast enough to use on GP2X Wiz. What I did was render everything in software with those blitters, then blast it to the screen with OpenGL. You could do the same but with GDI or something like that, and that would probably in fact be faster than using OpenGL (I also used a Linux console framebuffer in my game and it was faster than OpenGL when using software rendering). The problem right now is those blitters aren't used except when compiling for GP2X... so you'd have to recompile Allegro to use them. The other thing is, the default drawing path will be used in all but the common blending cases, which I believe are ONE, ZERO and ALPHA, INVERSE_ALPHA, which at the time was the default alpha blending mode. So it's not ideal and it needs some work, but it might prove to be fast enough. Worth sharing anyhow.


What does this function do then?
I know it's late, but I was looking into the manual right now and found this...

The A5.1 Manual said:

ALLEGRO_RENDER_METHOD: 0 if hardware acceleration is not used with this display.

No hardware acceleration ==> no video bitmaps?


Well, yes, you can apparently run on software. I don't really recommend it though - I once accidentally tapped into software emulation once by loading bitmaps before creating the display, and even though I did only 2 blits per frame I had to measure the framerate in fpm rather than fps.

J-Gamer said:

No hardware acceleration ==> no video bitmaps?

No, it just tells you that DirectX/OpenGL will not be able to use HW acceleration. I think the intended use case is to set this before calling al_get_num_display_modes so it will only return those modes where acceleration is used. The flag is not very useful though. The only case where I can see it set to 0 is if the user runs with OpenGL and software Mesa - which may be faster on new systems than old GPUs, so really pointless to care about it.


Ok, it was just a wild guess ;D

Thread #607836. Printed from