|
load a big bmp |
Matheus Santos
Member #15,053
April 2013
|
I'm having trouble loading bmps great, I have bmp up to 33MB and I carry them in memory is too slow! it is possible to load a bmp so great in video? I have no video card. ps: sorry for the English. |
Dizzy Egg
Member #10,824
March 2009
|
Matheus Santos said: it is possible to load a bmp so great in video? I have no video card. Mehehe.
---------------------------------------------------- |
Matheus Santos
Member #15,053
April 2013
|
WHY AL4 LOAD THE BMP AND AL5 NO? '-' |
Thomas Fjellstrom
Member #476
June 2000
|
Allegro 5 loads bitmaps into video memory by default, and is limited to the maximum texture size your video card is capable of. These days thats a maximum size of 4096x4096. You can override that by forcing new bitmaps to be system memory bitmaps by using al_set_new_bitmap_flags before creating or loading the large bitmaps. And yes, you do have a video card, it just might be integrated into your computer. -- |
Matheus Santos
Member #15,053
April 2013
|
when I load a bitmap from memory the program is too slow, is this normal? |
Thomas Fjellstrom
Member #476
June 2000
|
Completely normal. Memory bitmaps are slow, video bitmaps are (super) fast. -- |
pkrcel
Member #14,001
February 2012
|
usually, yes. It is unlikely that Google shares your distaste for capitalism. - Derezo |
Matheus Santos
Member #15,053
April 2013
|
other question, i run the same program in allegro 4 and this is more faster than allegro 5... what allegro 4 have that allegro 5 dont? |
Thomas Fjellstrom
Member #476
June 2000
|
Allegro 4's memory drawing code can be faster. But if you modify your program to work with how Allegro 5 wants things to work (split large bitmaps into smaller ones so you can load them into video memory), it'll be MUCH faster than Allegro 4, especially once you start using blending. -- |
pkrcel
Member #14,001
February 2012
|
n00b Question: that limit of squared 4096 pixels....how much raw data memory could actually be? It is unlikely that Google shares your distaste for capitalism. - Derezo |
Thomas Fjellstrom
Member #476
June 2000
|
If you mean how much memory a 4k texture would take, 4096 * 4096 * (bitdepth/8). For 32bit, thats 64MB. -- |
pkrcel
Member #14,001
February 2012
|
yes precisely! I was asking just for confirmation, I was wondering if I got it right. It is unlikely that Google shares your distaste for capitalism. - Derezo |
Elias
Member #358
May 2000
|
Also, memory bitmaps don't have to be slower. Just make sure to use only memory bitmaps (especially, also have the target bitmap be a memory bitmap and not the display backbuffer) and turn off blending (in A5 it's on by default). -- |
Matheus Santos
Member #15,053
April 2013
|
how can I turn off the blender? |
Thomas Fjellstrom
Member #476
June 2000
|
If you haven't enabled it, you're not using it. I think your problem might be drawing a large memory bitmap to the display. which can be quite slow. Drawing into your memory bitmap should be nearly or as fast as Allegro 4. -- |
Matheus Santos
Member #15,053
April 2013
|
I load one big bmp and then put into an array of bitmaps (all in memory) and drawing in a buffer created in memory but still too slow EDIT All images was loaded in memory |
Elias
Member #358
May 2000
|
To turn off blending, basically do something like: al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); This should make al_draw_bitmap result into basically a memcpy per row. -- |
Matheus Santos
Member #15,053
April 2013
|
now it's fast, but it has some images that are not being drawn... some ideia why? |
|