Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Allegro5 software

This thread is locked; no one can reply to it. rss feed Print
Allegro5 software
komons
Member #11,083
June 2009

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

Matthew Leverton
Supreme Loser
January 1999
avatar

Yes, if you don't need an ALLEGRO_DISPLAY.

komons
Member #11,083
June 2009

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

jmasterx
Member #11,410
October 2009

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
Member #1,146
March 2001
avatar

He may just be making a console app.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

komons
Member #11,083
June 2009

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
Member #476
June 2000
avatar

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.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Mark Oates
Member #1,146
March 2001
avatar

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

Really? I thought all the operations had software fallbacks.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Matthew Leverton
Supreme Loser
January 1999
avatar

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
Member #261
April 2000
avatar

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.

J-Gamer
Member #12,491
January 2011
avatar

What does this function do then?
al_set_new_display_option(ALLEGRO_RENDER_METHOD,0,ALLEGRO_REQUIRE);
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?

" There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo
"If your body was a business, thought would be like micro-management and emotions would be like macro-management. If you primarily live your life with emotions, then you are prone to error on the details. If you over-think things all the time you tend to lose scope of priorities." - Mark Oates

Itachihro
Member #12,001
May 2010

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.

Elias
Member #358
May 2000

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.

--
"Either help out or stop whining" - Evert

J-Gamer
Member #12,491
January 2011
avatar

Ok, it was just a wild guess ;D

" There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo
"If your body was a business, thought would be like micro-management and emotions would be like macro-management. If you primarily live your life with emotions, then you are prone to error on the details. If you over-think things all the time you tend to lose scope of priorities." - Mark Oates

Go to: