[comp.sys.ibm.pc] Turbo C graphics

dunn@ihlpf.UUCP (09/17/87)

I am interested in doing some simple graphics on the PC, i.e.- lines,
boxes, circles, etc.., and would like to use Turbo C as the language. Is there
a graphics toolbox for Turbo C, or has someone written a graphics drawing
program in Turbo and wouldn't mind sharing the source with me. Thanks in
advance.
			Bill Dunn
			ihnp4!ihlpf!dunn

spee@qmfl.jrdc.go.jp (Paul SPEE) (11/01/89)

A friend of mine wants to know whether it is possible to draw
lines xor'ed with the screen in Turbo C.

Paul Spee

spee%jrdc.go.jp@RELAY.CS.NET

rener@cs.eur.nl (Rene Roelofs) (11/02/89)

spee@qmfl.jrdc.go.jp (Paul SPEE) writes:

>A friend of mine wants to know whether it is possible to draw
>lines xor'ed with the screen in Turbo C.

the routine setwritemode set the writing mode for graphics line drawing

void far setwritemode(int mode)

   mode = 0 : overwrite
        = 1 : perform XOR put.

I used this for drawing lines across a picture and removing the line
again with the same routine. This works fine and fast.
( I'm talking about TC 2.0 here BTW .. )

-- 
    |-----\                        Rene Roelofs 
    |     |                        Dept. of Computer Science
   /|-----/                        Erasmus University Rotterdam, The Netherlands
   \|  \                           uucp: mcvax!hp4nl!eurtrx!euraiv1!rener          /|    \

David_Dave_Tamashiro@cup.portal.com (11/03/89)

The only way I can think of to XOR lines in Turbo C is to use
the get_image and put_image functions.  After saving the current screen
using get_image(), clear the screen and draw your line.  Then put
the old screen back using put_image() using the XOR option.  This is
slow and kludgy method.

Another gripe I have about the TC graphics package is that the graphics
mode text functions OR themselves on the screen.  This causes me to have
to erase part of the screen whenever I do any screen writes.

TEITTINEN@cc.helsinki.fi (Marko) (11/07/89)

In article <452@qmfl.jrdc.go.jp>, spee@qmfl.jrdc.go.jp (Paul SPEE) writes:
> A friend of mine wants to know whether it is possible to draw
> lines xor'ed with the screen in Turbo C.

If I recall right I think there is a function named setwritemode() that
is used to set graphics in xor/copy(normal) mode. To draw lines with
xor-operation use setwritemode(XOR_PUT) and to restore original drawing
mode use setwritemode(COPY_PUT). I'm not quite sure about this so look
it up from the manual.

-- 
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