From: Shawn H. <sh...@ta...> - 1999-03-30 23:27:13
|
George Foot <geo...@me...> writes: >Don't call Allegro functions before initialising Allegro, and >don't load any images for use in high colour depth modes until >you've set the graphics mode unless you really know what >you're doing. That is of course very good advice. But you've made me think, this is a very common problem. Is there any way that we can prevent people from making this mistake? Unfortunately I can't just bomb out from any text mode bitmap load calls with an error message, because there are some situations where that is actually valid (eg. in the dat utility). But almost always, it is an error. Perhaps any bitmap load call without first either setting a graphics mode or calling set_color_conversion() should generate an assert failure? Another thing that occurred to me is that it might be a good idea to initialise the default truecolor pixel format to BGR, rather than the current RGB. Rationale: this would still work correctly for programs like dat that do all manipulations in text mode, but would create an obvious visual error if programs get the loading and mode setting in the wrong order, because the display would be RGB while their data was BGR. At the moment that kind of code contains a subtle error because it will fail only on rare hardware, but if I changed this, it would go wrong obviously on most machines, so people would be forced to find and fix the problem. Is that worthwhile, or is it to cruel for me to break all the programs that currently "sort of" work? -- Shawn Hargreaves - sh...@ta... - http://www.talula.demon.co.uk/ "A binary is barely software: it's more like hardware on a floppy disk." >From <all...@ma...> Tue Mar 30 16:02:23 1999 Received: from mail1.gmx.net [195.63.104.61] by mail.canvaslink.com (SMTPD32-4.06) id ABD9D102B6; Tue, 30 Mar 1999 16:02:17 -0500 Received: (qmail 28421 invoked by uid 0); 30 Mar 1999 21:01:52 -0000 Received: from unknown (HELO comserv.schimanski.de) (141.41.13.106) by mail1.gmx.net with SMTP; 30 Mar 1999 21:01:52 -0000 Received: from stefan (stefan.schimanski.de [192.168.0.1]) by comserv.schimanski.de (8.8.8/8.8.8) with SMTP id TAA02326 for <al...@ma...>; Tue, 30 Mar 1999 19:01:07 +0200 Message-ID: <009901be7ad7$9c1212a0$010...@sc...> From: "Stefan Schimanski" <1S...@gm...> To: <al...@ma...> References: <Pin...@sh...> Subject: Re: [AL] WinAllegro: Is there a way to do accellerated masked blits without crashing? Date: Tue, 30 Mar 1999 20:03:26 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Precedence: bulk Sender: all...@ma... Reply-To: al...@ma... X-UIDL: 905450769 Status: O Content-Length: 310 Lines: 14 > > Hi. Is there a way to use DirectX's color-key functions on a surface > attached to an allegro bitmap without it crashing? > > If so, how about an example code for it? No, this is not possible in the current WIP. -- o Stefan Schimanski ( ) 1S...@gm... o http://1Stein.home.pages.de |