Hi Thomas,

I tend to find that getchar suits my needs perfectly. Making a call to getchar and ignoring the return value does exactly what you describe, and in a portable way. getch is non-standard as you know so may or may not be present on any given target.

Kind regards,

Philip Bennefall
----- Original Message ----- From: "Thomas Ward" <thomasward1...@gmail.com>
To: "Gamers Discussion list" <gamers@audyssey.org>
Sent: Wednesday, April 16, 2014 5:32 AM
Subject: [Audyssey] Pausing the Screen in Console Programs


Hi all,

This question is mostly for developer's but any thoughts from
non-developers are welcome as well.

At the moment I am working on a quick and dirty text adventure system
written in C++ suitable for developing classic interactive fiction
games similar to games like the Infocom text adventures like Zork,
Arthur, Hitch Hikers Guide to the Galaxy, and so forth. Since I am not
really a fan of the text adventure languages like Inform and AGT I
have decided to create my own system in C++, but have run into a
slight problem with the text adventure system.

In Dos/Windows if one wants to pause a screen of text all he or she
has to do is call the _getch() function which will pause the out put
until the enter or space key is pressed. Mac OSX and Linux have no
such function and similar functionality has to be accessed through
ncurses or another library like that. I am trying to come up with a
pause function that will be completely cross-platform and will compile
on any platform without having to involve ncurses or some other
third-party solution. So what I have done in the meantime is use the
standard cin input stream with a prompt that says, "press c to
continue or q to quit." I am wondering if people are okay with this
method of pausing the screen, or if some of you  developers knows of a
better way to go about pausing the text  on screen let me know.

Thanks.

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.


---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to