Bay 12 Games Forum

Other Projects => Curses => Topic started by: Epsilon on March 13, 2003, 12:42:00 am

Title: Curses use
Post by: Epsilon on March 13, 2003, 12:42:00 am
I was wondering if someone could tell me how I can use Curses in my own ASCII game programming.  I assume that I can somehow use curses.dll as I'd like to use Studio .Net if i can to develop but any hints or tips to somehow find somewhere to download Curses and get it running on any compiler are appreciated.

Thanks.

Title: Re: Curses use
Post by: Toady One on March 13, 2003, 01:13:00 am
You'll need a header file and a library file to write Curses programs.  You can find PDCurses all over the internet.

You can try this:

PDCurses

although it isn't the exact same as the one I use.  I'm having trouble finding the link.  I still have the zip file (for Visual Studio) if you want it.

There seem to be lots of implementations.

Curses Help Files (Look in Chapter 2)

There are a number of tutorials around.  If you have any specific questions once you get started with these files, let me know.

Title: Re: Curses use
Post by: Epsilon on March 15, 2003, 01:31:00 am
I've downloaded PDCurses before but couldn't get it to work right with Visual Studio.  Always willing to get another shot though if you've got some trick as to how I can get the compiler to recognize the curses.h file and the plethora of functions contained within.
Title: Re: Curses use
Post by: Toady One on March 15, 2003, 01:43:00 am
You need to use the curses library.  Even with the DLL, it seems to need the regular library file too.  Here is the zip file that I use:

Curses

The layout is more straight-forward than other versions I've seen on the net.  Just include "curses.h" and link "curses.lib" with your Visual Studio project.  Then it should recognize curses functions.

Be warned that "curses.h" has a ton of badly named macros in it, so names that you might want to use yourself (such as clear() and erase()) are already reserved.  I've taken to commenting out things in curses.h that I don't want.

Let me know if it works.  I used Visual Studio 6 for the games in the Curses Arcade, so I should be able to get you through to a compiled program.

[ March 15, 2003: Message edited by: Toady One ]

Title: Re: Curses use
Post by: Epsilon on March 26, 2003, 05:21:00 pm
Sorry to not reply for awhile, been kinda preoccupied.

Here's a stupid question:
How exactly do I go about linking curses.lib with my Visual Studio project?

Title: Re: Curses use
Post by: Toady One on March 26, 2003, 06:09:00 pm
There are a couple of ways that should work.

One is to add the file to the work space that's on the left (where your source files are).  You right click where it says "<name> files" and select "Add Files to Project".  Or you can go up to PROJECT:Add to Project:Files and put curses.lib in there.

So in my Workspace "Liberal Crime Squad"
I have game.cpp, curses.h, and curses.lib
under the Fileview tab.

The other way is to go into (in MSVC6, anyway) the menu at the top
PROJECT:SETTINGS (or Alt + F7).
Then select the tab "Link" on the right.
There should be a field called
Object/Library modules.  Just
type in curses.lib there, assuming
you've stuck the lib file in your
MSVC lib directory (or in the main
directory with your source might work
too).  If you have both debug and release modes for your project, you'll want to make sure you Link it into both if you use this method.

Title: Re: Curses use
Post by: Epsilon on March 26, 2003, 11:57:00 pm
Ok thanks, got things to compile.  Now just have to go do some reading on how to use it all!
Title: Re: Curses use
Post by: spelguru on March 27, 2003, 02:55:00 pm
I am just posting this to make sure that the tripe lpbs remains.

lbps: Last Post By Spelguru

Have fun all!

Title: Re: Curses use
Post by: Demon on March 29, 2003, 04:57:00 pm
How do you do the real time input for most of the curses games you made??  I know of only getch() and cin and both of those delay for a keystroke.
Title: Re: Curses use
Post by: Demon on March 29, 2003, 06:59:00 pm
Are you ever going to release the source code to any of your games?  I'd like to look through BCoS to learn a little...
Title: Re: Curses use
Post by: Demon on March 30, 2003, 05:03:00 pm
The forum dosnt seem to realise I'm posting, so I'm trying again...
Title: Re: Curses use
Post by: tahujdt on April 29, 2013, 10:42:08 pm
Bumping a thread from 2003. Lol.
Title: Re: Curses use
Post by: Jboy2000000 on April 29, 2013, 10:44:34 pm
Why?
Title: Re: Curses use
Post by: tahujdt on April 29, 2013, 10:45:15 pm
Because.
Title: Re: Curses use
Post by: Cheedows on April 29, 2013, 11:32:48 pm
Hey, a decade old forum necro isn't too shabby
Title: Re: Curses use
Post by: Jonathan S. Fox on April 30, 2013, 12:01:29 am
I was very polite and indifferent when you bumped the National LCS thread because it was relevant to an ongoing discussion and I wanted to assume your one word bump was well-intentioned. But don't make a habit of this sort of thing.

I'm a big softie when it comes to thread necromancy. People bump threads about various other games, or otherwise seek to revive a years-old discussion, and I don't blink twice. But bumping ten year old threads just because you can... mmm. It's cute once, but it's going to get old fast. Everyone else needs to use the forum too; please don't make it harder for them to find current content.