Mail Archives: djgpp/1998/10/04/16:51:35
Johnny wrote:
> I just got djgpp with Rhide and allegro up and running and entered the
> following code (see below). And all I come up with is a blank screen.
> Am running Win98 on a PII 300 with a Graphics Blaster video card. This code
> should work. Thanks
> #include <allegro.h>
>
> int main()
> {
> allegro_init();
> install_keyboard();
> set_gfx_mode(GFX_VGA,320,200,0,0);
> textout_centre(screen,font,"Press Any Key.",160,100,255);
> readkey();
> return 0;
> }
The problem with this code is that you're specifying color 255 but this means
nothing until you tell it which palette you're using.
Insert the line ...
set_palette(desktop_palette);
...after set_gfx_mode and change the color in textout centre to 1 instead of
255, (I know this to be red), compile link and run.
Steve
- Raw text -