Article View: comp.os.msdos.programmer
Article #5196Need a good line drawing function for VGA
From: teittinen
Date: Thu, 14 Mar 1991 02:08
Date: Thu, 14 Mar 1991 02:08
29 lines
1993 bytes
1993 bytes
Hello!
I'm writing a program that draws red-blue stereopictures on the screen
and I have a problem. Now I probably should tell you that I'm writing
this program in TC++. Anyway, because I draw two pictures of the object
in different colors, I don't want either color to wipe the other out. So
I use XOR-mode for drawing the lines (setwritemode(1);). But now the
problem is that when two lines in one image overlap, the overlapping
part is erased. And this is not too rare, for I draw wire-frame images
of the objects.
So what I need is possibility to draw lines using OR-mode. But here I'm
unlucky, Borland doesn't give me chance to use OR-mode for drawing lines
(even though my VGA hardware can make it easily). I could implement this
feature myself, but when I implemented line drawing algorithm in C and
compiled it, it was 3 times slower than Borland library function (I
timed it with Profiler). And because I'm trying to do some animation
here, I'd need as fast routine as I can get.
I'm turning to you, my fellow programmers, and asking if anyone has
an assembler version of a suitable VGA line drawing function that he/she
could share with me. I'd be very grateful to get this function. Or is
there a suitable function in (gasp) Microsoft C, must I turn to them ?
Please, don't say so! I'll do (almost) anything but that :-)
--
E-Mail: teittinen@finuh.bitnet ! "Studying is the only way
teittinen@cc.helsinki.fi ! to do nothing without
Marko Teittinen, student of computer science ! anyone blaming you" -me
Technical Details
Message-ID:
<1991Mar14.020823.5530@cc.helsinki.fi>Path:
arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!hydra!cc.helsinki.fi!teittinenShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!hydra!cc.helsinki.fi!teittinen From: teittinen@cc.helsinki.fi Newsgroups: comp.os.msdos.programmer Subject: Need a good line drawing function for VGA Message-ID: <1991Mar14.020823.5530@cc.helsinki.fi> Date: 14 Mar 91 02:08:23 GMT Organization: University of Helsinki Lines: 29