Jump to content
  • Advertisement
Sign in to follow this  
Devil0150

Allegro graphics problem

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Looks like the image is drawn at a lower color depth. Maybe Allegro converts the image format when it loads it.

Post the code that loads the image, the code that draws the image, and the code that initializes Allegro.

Share this post


Link to post
Share on other sites
This is my main function:

int main()
{
allegro_init();
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 800, 600, 0, 0);
install_keyboard();
install_sound(DIGI_AUTODETECT, MIDI_NONE, "");
set_color_depth(32);
if (loadspr())
return 0;
initBoard();
// menu
ShowMenuBG();
ShowChoices();
GetMenuInput();
// in game
while (!key[KEY_ESC])
{
GetInput();
ShowBoard();
if (Results() == 1)
goto won;
}
won:
while(!key[KEY_ESC]);
// clean up
stop_sample(mySample);
destroy_bitmap(X);
destroy_bitmap(PLAY);
destroy_bitmap(menuBG);
destroy_bitmap(selector);
destroy_bitmap(OPTIONS);
destroy_bitmap(EXIT);
destroy_bitmap(bg);
destroy_bitmap(youLose);
destroy_bitmap(youWin);
destroy_bitmap(O);
destroy_bitmap(buffer);
destroy_bitmap(table);
destroy_sample(mySample);
allegro_exit();
return 0;
}



ShowMenuBG draws the image.

void ShowMenuBG()
{
blit(menuBG, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
}



Color depth of the image is 24.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!