|
MSVC8 Bitmaps |
xinco1
Member #8,061
December 2006
|
Ok, I'm currently moving from Dev-c++ to MS Visual C++ 2005 express edition. I've got it set up, with the microsoft platform SDK, and then followed this to install allegro: BITMAP *a = load_bitmap( "a.bmp", NULL);
This gives the error "This application has requested the runtime to terminate it in an unusual way." |
CGamesPlay
Member #2,559
July 2002
|
You need to check your return values: BITMAP *a = load_bitmap( "a.bmp", NULL); if(!a) { set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); allegro_message("Bitmap failed to load!"); exit(1); } Once you do that, put a.bmp into the Debug or Release folder of your project directory. -- Ryan Patterson - <http://cgamesplay.com/> |
xinco1
Member #8,061
December 2006
|
Ok, this is weird but it says |
CGamesPlay
Member #2,559
July 2002
|
Oh, of course. You can't load a bitmap on the global scope, you have to do it inside of a function. The reason is because allegro_init hasn't been called yet on the global scope, nor has set_color_depth or set_gfx_mode. So:
-- Ryan Patterson - <http://cgamesplay.com/> |
Paul whoknows
Member #5,081
September 2004
|
Quote: Ok, I'm currently moving from Dev-c++ to MS Visual C++ 2005 express edition. Why? ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
CGamesPlay
Member #2,559
July 2002
|
Because Dev-C++ is a bad IDE, MSVS has a great debugger, and it's free? -- Ryan Patterson - <http://cgamesplay.com/> |
xinco1
Member #8,061
December 2006
|
Quote:
Oh, of course. You can't load a bitmap on the global scope, you have to do it inside of a function. The reason is because allegro_init hasn't been called yet on the global scope, nor has set_color_depth or set_gfx_mode. So: int main(int argc, char* argv[]) a = load_bitmap( "a.bmp", NULL); I can't belive I missed that. Thanks! BTW: MSVS IS free but requires registration. It's more stable, easier to use(for example on really long peices of code, voids can be minimized) and the debugger really is supreme. |
BAF
Member #2,981
December 2002
|
It requires registration? I never had to register for my copies... |
|