[A5] al_get_new_display_option
wiseguy

Hi,

I'm trying to query the maximum loadable bitmap size, but not having any luck. I'm using:

maxBmp = al_get_new_display_option(ALLEGRO_MAX_BITMAP_SIZE, &importance);

The documentation says that when queried, ALLEGRO_MAX_BITMAP_SIZE returns both the maximum width and height, but the al_get_new_display_option function only returns one integer? Is the other size returned in importance? Or am I totally trying to do this the wrong way.

The reason I'm trying to figure this out is because I have two separate programs in which I try to load the same image. In one program, the image loads fine. In the other, it does not load. I am trying to figure out if perhaps the image is too large to load because of different display sizes?

Matthew Leverton

I would assume the returned size is both the height and width. e.g. 512 would be 512x512.

wiseguy

That's what I was thinking as well, but when I called the function it returned 0. On a side note, I switched the application back to a windowed display mode and the bitmap loaded correctly.

Matthew Leverton

Does al_get_display_option() work?

wiseguy

I have a screen resolution of 800x600 in windowed mode, and calling
<code>
maxBmp = al_get_new_display_option(ALLEGRO_MAX_BITMAP_SIZE, 0);
<code>

sets maxBmp to 0.

Maybe I'm just using it wrong. I will try to look through the A5 source and see what I'm missing.

[Edit]

Calling

  maxBmp = al_get_display_option(scr, ALLEGRO_MAX_BITMAP_SIZE);

sets maxBmp to 11.

Matthew Leverton

Maybe that means 2^11 or 2048x2048. I'm just guessing. :P

kenmasters1976

Interesting. It also returns 11 on my old integrated Intel graphics card and it doesn't support creating a 2048x2048 bitmap.

It returns 11 when using D3D and won't create a 2048x2048 bitmap. Using OpenGL it returns 2048 and 2048x2048 bitmap creation works.

The maximum bitmap size on my card seems to be 1024x1024 when using D3D.

Thomas Fjellstrom

I think you just found a bug in our D3D code.

wiseguy

Ok, so then I'm not just totally doing this wrong? If I can help with testing anything on windows let me know. On a side note, those function calls return the same numbers in both windowed and fullscreen mode, but the bitmap, which is 1824x1824, loads successfully in windowed mode.

[Edit]

Ok, interesting note: The bitmap loads successfully if I load it using my "load map" routine, but only fails when using al_load_bitmap using the path from the native filechooser. I am thinking this is probably more a problem on my end rather than a bug in allegro.

kenmasters1976

I think you just found a bug in our D3D code.

Funny that no one found it before as it seems like something you'd want to check in your code.

Trent Gamblin

Whenever those display options became retrievable, nobody bothered to update the direct3d code to handle them.

Since sourceforge won't reset my password, I can't commit a fix right now but here's a patch.

Thread #606233. Printed from Allegro.cc