Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!cbnewsc!tjr From: tjr@cbnewsc.ATT.COM (thomas.j.roberts) Newsgroups: comp.lang.c Subject: Re: Turbo C graphics library Message-ID: <14962@cbnewsc.ATT.COM> Date: 9 Apr 90 15:19:51 GMT References: <35769@cci632.UUCP> Distribution: na Organization: AT&T Bell Laboratories Lines: 25 From article <35769@cci632.UUCP>, by tre@cci632.UUCP (Todd Engle): > I would like to find out if one can have a visible cursor in a > graphics window... > Also, is it possible to have reverse video in graphics mode in Turbo C? A cursor CAN be displayed in graphics mode, but you must do it manually. On most PCs, printf (etc.) can be used in graphics mode, and will work as expected (chars 0-127 only), storing the pixel representation of the characters onto the graphics screen (both background and foreground). If you use a direct BIOS call to display with the BLINK attribute, then the foreground pixels of the character will be XORed onto the display. Thus, you can display an underscore (_) as a cursor, using XOR mode, and move it for every character typed (must use getch() or getche(), or a similar BIOS call, cannot do a buffered read). Getting the cursor to blink is a real challenge, as you must do the timing yourself, in parallel with the getch(); if you are also looking for mouse events as well, it can get pretty complicated, so you will probably need to go to an input-event design with a single input-event queue into which TIMER, KEYBOARD, and MOUSE events are all placed. Good Luck. I have never tried using TC's TEXTMODE routines (cprintf, gotoxy(), etc.) in GRAPHICS mode. Tom Roberts att!ihlpl!tjrob