Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Clarification on bitmap flags in A5

Credits go to Matthew Leverton for helping out!
This thread is locked; no one can reply to it. rss feed Print
Clarification on bitmap flags in A5
Don Freeman
Member #5,110
October 2004
avatar

I would like to get clarification as to if I need to store and then restore the state for the bitmap flags if I was to load a memory bitmap and then want to switch back to video bitmaps in a5.

ALLEGRO_STATE state;
al_store_state(&state,ALLEGRO_STATE_NEW_BITMAP_PARAMETERS);
al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP);
al_load_bitmap("someImage.png");
al_restore_state(&state);

That is what I am doing now. This file will load fine on some video cards, but not others unless it is loaded as a memory file...that is why I ask. The API states ALLEGRO_STATE_NEW_BITMAP_PARAMETERS and I am only assuming that this means flags and format. Thanks for you input.

--
"Everyone tells me I should forget about you, you don’t deserve me. They’re right, you don’t deserve me, but I deserve you."
"It’s so simple to be wise. Just think of something stupid to say and then don’t say it."

Matthew Leverton
Supreme Loser
January 1999
avatar

ALLEGRO_STATE_NEW_BITMAP_PARAMETERS - new_bitmap_format, new_bitmap_flags

So it should work. Alternatively you could use al_get_new_bitmap_flags():

The image fails to load on some computers probably because of the image's size. It must be smaller than the maximum texture size (can be queried).

Don Freeman
Member #5,110
October 2004
avatar

Yeah, it is the size. It is 2512x16 or something to that effect. I use it as a tile map. I thought about doing that as well ( old = al_get_new_bitmap_flags(); ), but as long as the state method works, I'll probably just use that. I was originally thinking of setting a config option that the user can select, but if I can do it all programmically, all the better. Thanks! :)

--
"Everyone tells me I should forget about you, you don’t deserve me. They’re right, you don’t deserve me, but I deserve you."
"It’s so simple to be wise. Just think of something stupid to say and then don’t say it."

Matthew Leverton
Supreme Loser
January 1999
avatar

I think querying the max texture size doesn't work in D3D on 5.0.0, but it should return something like 2048.

2512x16 is only 40,192 pixels. If you made it square (2048x2048) you'd get 4M to work with.

kenmasters1976
Member #8,794
July 2007

I think querying the max texture size doesn't work in D3D on 5.0.0

I thought it was fixed before the release of Allegro 5.0.0, wasn't it?.

[EDIT:] Looks like it wasn't. On my old integrated Intel card, it returns 2048 but the actual max bitmap size is 1024x1024.

Go to: