delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/06/02:45:27

Newsgroups: comp.os.msdos.djgpp
From: manni DOT heumann AT gmx DOT de (Manni Heumann)
Subject: Re: Conflict between IOSTREAMs and VGA writes
References: <398CFC29 DOT 4FAF2159 AT alpha DOT delta DOT edu>
X-Newsreader: News Xpress 2.01
Mime-Version: 1.0
Date: Sun, 06 Aug 2000 06:38:04 GMT
NNTP-Posting-Host: ppp36-24.hrz.uni-bielefeld.de
Message-ID: <398d07d0_1@news.uni-bielefeld.de>
X-Trace: 6 Aug 2000 08:38:08 +0200, ppp36-24.hrz.uni-bielefeld.de
Lines: 36
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

[SNIP]
>When wrote a program to draw 1/8 of a circle using Bresenham, the VGA
>screen started to scroll away after a number of pixels had been
>drawn!  I tried to find the bug in my routine for several days, and
>was about to give up when the thought of trying simpler CONIO routines
>occurred to me.  When I replaced the IOSTREAM functions with CONIO
>equivalents, the program worked just fine!  
>
[SNIP]

Hi Dave,

you are half right. The iostream version shows strange behavior. But so 
does the conio version. I guess the problem is that both, cin and getch 
echo the characters they receive, which is of course what they are 
supposed to do (ever tried to press something else then space or 
return?).

In C++ there is no portable way to read a single character without a 
terminating end of line. And of course neither is there in C. But at 
least you find a lot of C Compilers that offer the conio functions. I 
would try this with some function that does not echo characters, like 
kbhit().

I guess you told your students a fine lesson. Graphics programming 
without a decent library to help you is indeed not that easy. I just 
hope they will not get the idea that the only decent library to work 
with is mfc. If they are interested, introduce them to Allegro.


--

Manni

Life would be much easier if I had the source code.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019