Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Curses use  (Read 6801 times)

Epsilon

  • Escaped Lunatic
    • View Profile
Curses use
« 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.

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Curses use
« Reply #1 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.

Logged
The Toad, a Natural Resource:  Preserve yours today!

Epsilon

  • Escaped Lunatic
    • View Profile
Re: Curses use
« Reply #2 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.
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Curses use
« Reply #3 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 ]

Logged
The Toad, a Natural Resource:  Preserve yours today!

Epsilon

  • Escaped Lunatic
    • View Profile
Re: Curses use
« Reply #4 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?

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Curses use
« Reply #5 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.

Logged
The Toad, a Natural Resource:  Preserve yours today!

Epsilon

  • Escaped Lunatic
    • View Profile
Re: Curses use
« Reply #6 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!
Logged

spelguru

  • Guest
Re: Curses use
« Reply #7 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!

Logged

Demon

  • Bay Watcher
  • From a time before a time before time
    • View Profile
Re: Curses use
« Reply #8 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.
Logged

Demon

  • Bay Watcher
  • From a time before a time before time
    • View Profile
Re: Curses use
« Reply #9 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...
Logged

Demon

  • Bay Watcher
  • From a time before a time before time
    • View Profile
Re: Curses use
« Reply #10 on: March 30, 2003, 05:03:00 pm »

The forum dosnt seem to realise I'm posting, so I'm trying again...
Logged

tahujdt

  • Bay Watcher
  • The token conservative
    • View Profile
Re: Curses use
« Reply #11 on: April 29, 2013, 10:42:08 pm »

Bumping a thread from 2003. Lol.
Logged
DFBT the Dwarf: The only community podcast for Dwarf Fortress!
Tahu-R-TOA-1, Troubleshooter
Quote
I suggest that we add a clause permitting the keelhauling of anyone who suggests a plan involving "zombify the crew".
Quote from: MNII
Friend Computer, can you repair the known universe, please?

Jboy2000000

  • Bay Watcher
  • Hello good people of the interwebs!
    • View Profile
Re: Curses use
« Reply #12 on: April 29, 2013, 10:44:34 pm »

Why?
Logged
"Wanna be a better liberal? Go get shot in the fuckin' face."

Just goes to show, even a Male Doctor that Looks Like a Female and a Criminal with Poor Hygiene Habits can fall in love.

tahujdt

  • Bay Watcher
  • The token conservative
    • View Profile
Re: Curses use
« Reply #13 on: April 29, 2013, 10:45:15 pm »

Because.
Logged
DFBT the Dwarf: The only community podcast for Dwarf Fortress!
Tahu-R-TOA-1, Troubleshooter
Quote
I suggest that we add a clause permitting the keelhauling of anyone who suggests a plan involving "zombify the crew".
Quote from: MNII
Friend Computer, can you repair the known universe, please?

Cheedows

  • Bay Watcher
  • Still a dwarf, right?
    • View Profile
Re: Curses use
« Reply #14 on: April 29, 2013, 11:32:48 pm »

Hey, a decade old forum necro isn't too shabby
Logged
Pages: [1] 2