Sign in to follow this  
rubiksnut

Allegro Bitmap load from static object

Recommended Posts

rubiksnut    133
I have a class to manage my game in allegro. It uses a very minimal number of loaded resources (2 to be exact). While writing the code initially, I declared an instance of the class normally from the main function. Now, I decided to change it to a static instance declared in a header, so as to make it easier to work with lua. The problem is that when I use the static object, neither the bitmaps nor the audio files will load. A null pointer is returned to indicate failure, and when the application attempts to blit the image, the program fails. Does anyone have any idea why this might be happening?
failure = load_bitmap("fail.bmp", NULL);//fails
failsound = load_sample("das_failure.wav");//fails as well

Share this post


Link to post
Share on other sites
Narf the Mouse    322
I've never used Allegro, but normally, instance objects and static classes are different things that aren't intended to interact. It may be that you're attempting to do something the language was never intended to carry out.

Share this post


Link to post
Share on other sites
rubiksnut    133
I'm sorry, but I mistitled my post. It should actually read (as it does now) "Allegro Bitmap load from static object." I am not actually using a static class; I am using a static object.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this