From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro: palette suggestions Date: Sun, 22 Jun 1997 14:13:33 +0100 Organization: None Distribution: world Message-ID: References: <33AC37C4 DOT 30F0 AT cs DOT colostate DOT edu> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 33 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk SerDevian writes: >- get_palette() doesn't work right after a set_gfx_mode(). After Yup: I don't have any code to read the current palette back from the graphics card, so it is undefined until you set it with Allegro functions. The reason for this is that some recent cards don't support the standard VGA palette registers while in SVGA (particularly accelerated) modes, and neither the VBE 2.0 protected mode interface or the new VBE/AF spec provides any way to read the palette. I could use the real mode VESA interrupt instead of the VBE 2.0 call for this, but that isn't guaranteed to work along with a VBE/AF driver (not a big deal at the moment, but someday I hope to support /AF more fully, once SciTech finish implementing it). Since there's no certain way to do this on all cards and in all modes, I think it's better not to attempt it in the first place: partial support for a feature can cause a lot of subtle bugs with code that works fine on 99% of cards but fails on the hundredth... >- Perhaps bestfit_color() and bestfit_init() should not be static. They >are very useful functions, and would make good additions to the official >color/palette functions. (it gives more control and flexibility than >makecol8()) I don't see what those functions do that makecol8() doesn't: the only difference is that makecol8() is optimised to use the rgb_map lookup table if it exists, and uses the current palette rather than taking a palette as an argument. Is that really useful enough for it to be worth cluttering the API with two more external functions? -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ Beauty is a French phonetic corruption of a short cloth neck ornament.