Date: Tue, 31 Mar 1998 21:54:56 -0800 (PST) Message-Id: <199804010554.VAA22755@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Nicolas Blais , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: **HELP!** can someone modify my sub-routine to make it better? (vesa.cpp) Precedence: bulk At 07:48 3/30/1998 -0500, Nicolas Blais wrote: >Hi, I don't know how many times I asked this but, please, can you make >my code better? Phrasing like "make my code better" tends to offend people, that could be the reason for the small response. They think you are asking them to do your work for free. A better way would be something like, "Does anyone know why this is slow?" > Especially that put_char() that I got from someone >else, it's effecient, but it's 2 lines of code that I know you can turn >into 1. >void put_char(int ch, int color) >{ > __dpmi_regs r; > r.h.ah = 0x0e; > r.h.al = ch; > r.h.bh = 0; > r.h.bl = color; > __dpmi_int(0x10, &r); >} I don't know that I'd call this "efficient". The BIOS is notoriously slow for video routines. Also, I believe it's not reliable to use BIOS text functions in VESA modes. "If you want the job done right, do it yourself." You'll probably have to write your own routine that loads a font of some kind and generates and draws the characters itself. > Also, make my putpixel() better, I heard it was slow and >awkward. Using `putpixel' in general is slow and awkward! Consider some sort of buffering algorithm. comp.graphics.algorithms would be a good place for that. Nate Eldredge eldredge AT ap DOT net