Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » 1080p fullscreen crash

This thread is locked; no one can reply to it. rss feed Print
1080p fullscreen crash
thebignic
Member #14,419
July 2012

Edit: I'm using 5.0.7 with gcc

I can't replicate this bug, but I'm hearing reports from users that when they try to run my game in 1080p (possibly only in fullscreen window) it crashes when loading the first graphic.

Oddly enough, it seems like the program is getting passed initialization and it only crashes when I go to load the first bitmap. It shouldn't even get that far if initialization fails (ie: no display object created)

al_init succeeds
al_create_display succeeds
al_get_display_option succeeds (getting/checking max bitmap size)
I load the primitives addon, fonts, and create an event queue, all successfully.
As soon as I al_load_bitmap, it returns null?

At least one user has multiple monitors of different resolution capabilities, and the primary monitor does not support the resolution while the secondary does. I could see this being a problem with enumerating the options but is the fullscreen window option limited to what the <I>primary display</I> can handle?

So I'm wondering if anyone has run into issues with 1080p (1920x1080) either as a regular window or fullscreen windowed modes.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

thebignic said:

al_init succeeds
al_create_display succeeds
al_get_display_option succeeds (getting/checking max bitmap size)
I load the primitives addon, fonts, and create an event queue, all successfully.
As soon as I al_load_bitmap, it returns null?

You forgot al_init_image_addon().

If al_load_bitmap still returns null it is probably because it cannot find the image you're looking for due to problems with the current working directory.

See Loading Resources : Troubleshooting for details.

Edit - 5.0.7 is old, you should upgrade to 5.0.10 if you can.

thebignic
Member #14,419
July 2012

I'm doing a hundred other things during init - I didn't list them all. al_init_image_addon() is there and successful.

I was just trying to convey that there are a tonne of functions that are successful before loading a resource, and that loading a resource shouldn't fail because of a particular resolution.

But in all instances of this bug, that's the first indication that there's any sort of problem and only at 1920x1080.

I'll try 5.0.10...

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

How large is the bitmap you are trying to load? It may exceed maximum texture size and fail to load. I don't know if al_load_bitmap will return a memory bitmap in the case of excessive size if you request a video one. I don't think this is the problem though, as his graphic card should support a fairly large texture if his resolution is 1080p.

The image format may be unsupported. Try a different image.

The path may be wrong. Print out the CWD.

thebignic
Member #14,419
July 2012

The image is like 320x240. The same bitmap loads under every other screen resolution. Also, the working directory isn't likely changing under one screen resolution but I'll look into it.

EDIT: Found a handful of memory leaks where I was calling al_get_current_directory and not freeing the allocated memory. This appears to have solved the issue 100% even though I'm not entirely sure why. If I don't retain a pointer to that memory and clear it, the worst that should happen is that it gets overwritten or cannot be allocated for the duration of the run, correct? Since there was no pointer, the return value was simply being dumped to console in all cases. How could this possibly have an effect on one screen resolution???

EDIT: (Why cant I reply to this thread?)

Go to: