# "background" in allegro

This topic is 4228 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi i have a problem with my simple game. I don't know how to put in background a picture (.bmp). I put in my game trees , people , and other things... but in background i have only black...and i want to chance this thing One more question ...I use a buffer for draw at my screen so I draw my picture in a buffer and the buffer in my screen ... This is good or bad..I tink... i can draw only to screen... I use C++

##### Share on other sites
If I put the background like this ... i get an error ...
draw_sprite(buffer,backgound,800,600)draw_sprite(buffer, image1, image1_x_position, image1_y_position)	draw_sprite(buffer, image2, 500, 300);		draw_sprite(buffer, image2, 300, 100);		draw_sprite(buffer, image2, 200, 50);		draw_sprite(buffer, image2, 50, 50);

##### Share on other sites
Quote:
 Original post by TheFleaIf I put the background like this ... i get an error ... *** Source Snippet Removed ***Thz in advence

Only error I see there is that blitting to 800, 600 might put it right off the screen (did you mean 0, 0?) Assuming background is a valid BITMAP*, that should work fine.

##### Share on other sites
Do'h.. Yes .. i want to put my image to (0,0) not at (800,600) ...
and my image was not valid BITMAP* ... Problem solved...This is the great forum for programming

.

##### Share on other sites
For performance reasons, you really shouldn't use draw_sprite if there are no transparent pixels. Use blit() for copying solid bitmaps.