Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » [a5] Starting from scratch with a bitmap:Cant draw to target. Need to set flags?

This thread is locked; no one can reply to it. rss feed Print
[a5] Starting from scratch with a bitmap:Cant draw to target. Need to set flags?
Phrasz
Member #10,091
August 2008

So I have been starting at my code too long, and I can't recall what needs to be done to be able to draw and then render a bitmap.

If declare the bitmap, and try

#SelectExpand
1ALLEGRO_BITMAP *HUDLayer; 2 3... 4 5al_set_target_bitmap(HUDLayer); 6al_draw_filled_rectangle(0,0,1920,1080,al_map_rgb(0,150,255)); 7al_set_target_backbuffer(Display); 8 9... 10 11al_draw_bitmap(HUDLayer,0,0,0); 12al_flip_display();

This causes a crash.

However, if I al_load_bitmap() or al_clone_bitmap() to the bitmap, and then proceed with the above code it works just fine. What am I forgetting? (Needed Flags?)

Thanks in advance!

torhu
Member #2,727
September 2002
avatar

Phrasz
Member #10,091
August 2008

Fail...

:'-(

Thanks again!

Go to: