delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/17/05:40:30

From: "Travis" <slardy AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Whats up with the pink?
Date: Fri, 16 Jul 1999 16:57:40 -0400
Lines: 49
Message-ID: <7mo6hn$o8i$1@autumn.news.rcn.net>
X-Trace: TkK3lmuanTBUbFUwHuPz1ufEeyz8fbOhuScXYOkRyas=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 16 Jul 1999 21:00:39 GMT
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
X-Newsreader: Microsoft Outlook Express 4.72.3110.1
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I'm trying to make a quick application that uses Allegro.  I made it and the
only problem is the background is that bright pink used for transparency.
How do i make the background black or another color other than pink? here is
the code:

#include <iostream.h>
#include "allegro.h"

//Availible Res: 300x200, 640x480, 800x600, 1024x768, 1152x864

#define WIDTH 640
#define HEIGHT 480
#define PIC1 "omega.bmp"
#define SND1 "test.wav"

int main()
{

 SAMPLE *sound1;
 BITMAP *allegro;
 PALLETE pal;

 allegro_init();
 install_keyboard();
 set_gfx_mode(GFX_AUTODETECT, WIDTH, HEIGHT, 0, 0);
 install_sound (DIGI_AUTODETECT, MIDI_AUTODETECT, NULL);


    // Load Bitmap Into Memory
 allegro = load_bitmap(PIC1, pal);
 set_palette(pal);

 //Display Bitmap
 blit(allegro, screen, 0, 0, 0, 0, WIDTH, HEIGHT);

 //Play Scary Music
 sound1 = load_sample( SND1 );

 readkey();
 play_sample(sound1, 255, 128, 1000, 0);
 fade_out(1);
 stop_sample(sound1);
 destroy_bitmap(allegro);

 return 0;
}



- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019