|
Getting a bit of a problem with drawing a bitmap |
ILIKECHEEZ
Member #15,193
June 2013
|
Hey guys; 1
2#include <allegro5\allegro5.h>
3#include <allegro5\allegro_native_dialog.h>
4#include <allegro5\allegro_image.h>
5int main(){
6//bla bla bla stuff being done
7
8al_init_image_addon();
9ALLEGRO_BITMAP *player = al_load_bitmap( "spr1.png" );
10//more plebeian crap being done
11al_draw_bitmap(player,200,300,0);
12al_rest(10);
13al_destroy_bitmap(player);
14//The rest of the crap being killed
15return 0;
16
17}
was there an update that broke/changed something, could someone please point me in the right direction? Democracy is two wolves and a sheep voting on what's for dinner. |
Matthew Leverton
Supreme Loser
January 1999
|
If you were to chase down the error, you'd see it lead you here: 137/* Function: al_draw_tinted_bitmap
138 */
139void al_draw_tinted_bitmap(ALLEGRO_BITMAP *bitmap, ALLEGRO_COLOR tint,
140 float dx, float dy, int flags)
141{
143 al_draw_tinted_bitmap_region(bitmap, tint, 0, 0,
144 bitmap->w, bitmap->h, dx, dy, flags);
145}
Your bitmap is null. The solution is somewhere in this article, probably the bit about accessing the file from the properly qualified path. |
ILIKECHEEZ
Member #15,193
June 2013
|
Oh wow thankyou! Democracy is two wolves and a sheep voting on what's for dinner. |
Matthew Leverton
Supreme Loser
January 1999
|
That's only a temporary fix. Read the article: http://wiki.allegro.cc/index.php?title=Loading_Resources_(Troubleshooting)#Fix_the_Path |
|