Message-ID: From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Re: fprintf() and using under graphic modes Date: Tue, 23 Nov 1999 14:36:19 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp AT delorie DOT com Chaos writes: >> VESA is buggy. Allegro successfully works around the bugs. > > ??? > What you meen? My philosophy is that: If Allegro can do it > I can do it too. Of course. But the trouble with writing VESA code is that many (probably most) VESA drivers are extremely buggy, so no matter how well you write your code, it will still fail on some machines due to things that are outside your control. It would be nice if we could get away with this, but in the real world when your program crashes, most users will blame you for it, so it is nice if you can try to work around some of the more common driver bugs. Allegro certainly isn't perfect in this respect: if a driver is truly broken, there isn't anything you can do about that. But it has been through several years of intensive testing and tweaking to make it work on many different setups, which is hard to duplicate yourself unless you have a huge test lab (I couldn't have done it all myself either, but many people have debugged various parts of the code on different machines, and found fixes for specific problems that were affecting them). Writing your own code is very likely to produce more compact results, and you should easily be able to make your code 'correct', but it is unlikely that you can replicate all the obscure tweaking that has subsequently gone into the Allegro routines... >>> Now i'm wondering if I can do it safelly. Can I stick with >>> printing text messages such as timer or player name using >>> only printf-family functions. > >> They don't work on all cards. > > Why? Because not all VESA drivers bother to provide any text output functions. And this isn't actually a bug: the spec says that they are allowed not to do this. So if you want your program to work reliably on all machines, you cannot use printf() type functions in VESA graphics modes, and must write your own text plotting code instead. Store your own font graphics as part of the code, and draw them to the screen as a series of pixels in the same way as for any other graphics: that's not hard to do, and far safer than just hoping the BIOS will do this for you. Shawn Hargreaves.