delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/14/00:12:25

From: Kester Maddock <dmaddock AT xtra DOT co DOT nz>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help. Winallegro
Date: Sun, 14 Feb 1999 18:02:38 +1300
Organization: Customer of Telecom Internet Services
Lines: 58
Message-ID: <36C658EB.AA94324D@xtra.co.nz>
References: <7a4ma6$kv4$1 AT nclient3-gui DOT server DOT virgin DOT net> <7a4ven$f01$1 AT nclient5-gui DOT server DOT virgin DOT net>
NNTP-Posting-Host: 202-27-181-52.dialup.xtra.co.nz
Mime-Version: 1.0
X-Trace: titan.xtra.co.nz 918968775 2908 202.27.181.52 (14 Feb 1999 05:06:15 GMT)
X-Complaints-To: newsadmin AT xtra DOT co DOT nz
NNTP-Posting-Date: 14 Feb 1999 05:06:15 GMT
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

If set_gfx_mode returns a negative number, you can assume that the
selected colour depth does not work.  This goes for DOS Allegro
too.  WinAllegro uses DirectX, and apparently not all colour depths
are supported properly.
    int colours[] = {8, 15, 16, 24, 32};
    int i, e;
    for (i = 0; i < sizeof(colours)/sizeof(colours[0]); i++)
    {
      set_color_depth(colours[i]);
      e = set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
      if (!e)
        break;
    }
    if (e < 0)
    {
       /* Do some error condition: Graphics failed */
    }

Kester
dmaddock AT xtra DOT co DOT nz

Gary Smith wrote:

> By changing the colour depth to 15 bit, the program runs at the correct
> frame rate.
>
> If I set the colour depth to 16bit, and then call  'set_gfx_mode', this
> causes the program to crash.  How can I tell if the colour depth that is
> selected will work on someone elses computer.
>
> Gary Smith
>
> Gary Smith wrote in message <7a4ma6$kv4$1 AT nclient3-gui DOT server DOT virgin DOT net>...
> >Help.
> >
> >I have been working on a program using Winallegro as the graphics library.
> >
> >I have just upgraded my graphics card from a Matrox Mystique, 4MB to an ATI
> >Rage LT PRO, 8MB.
> >
> >With the Matrox card, I could run the program in 15bit, 16bit, 24bit & 32
> >bit at a reasonable frame rate.   With the ATI card, the program now runs
> at
> >approximately 10% of its previous speed.
> >
> >The ATI card should be faster than the Matrox card.
> >
> >I have tried setting various colour depths with no luck.
> >
> >Any suggestions.
> >
> >Gary Smith
> >
> >
> >
> >

- Raw text -


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