Mail Archives: djgpp/2000/08/06/02:45:27
[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 -