🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by Arthur Cinader Jr Sat, 16 Mar 1996 19:04
Character Graphics, g++, and curses
#929
Author: Arthur Cinader Jr
Date: Sat, 16 Mar 1996 19:04
42 lines
1738 bytes
I am learning to program.  I am also learning to program in
C++.  I am doing an excercise that requires drawing on the
screen.  Not fancy graphics, just character based stuff on a
plain ole 80x24 screen.  

I want to divide the screen into two sections.  

    The top twenty lines will be used for drawing geometric shapes
    -- this is a Draw Space Screen Object.  

    The bottom four lines will be used for interacting with
    the user -- this is the User Interface Screen Object. 

My prefernece would be to use cout and cin for the
user interface object and some kind of (X,Y) coordinate
addressing for the draw space screen object.

I do not have a fancy IDE and I am not about to get
one.  I am using gnu g++ v2.4 in a text based
environment.  That is the given.

I am planning on using curses to control the screen.
While this should do the trick, it will not allow me
to use cin and cout (I think!?!) for my user interface
screen object.  Instead, I will need to use addstr()
and getstr(). Not too bad.

My questions:

1.  Is there a library in g++ that is the oo equiv of
    curses I should be using instead?

2.  Any advice on using curses with g++.  Is there
    anything more I need to know than just 
    g++ -c MyClass.C -lcurses

You can also look at this message as a preamble to the
questions sure to follow. 

Thanks!

Arthur
Re: Character Graphics, g++, and curses
#934
Author: Brian Joseph Cully
Date: Thu, 28 Mar 1996 16:33
20 lines
1172 bytes
In article <4if3bf$d33@panix.com>,
Arthur Cinader Jr <acinader@panix.com> wrote:
>I am planning on using curses to control the screen.
>While this should do the trick, it will not allow me
>to use cin and cout (I think!?!) for my user interface
>screen object.  Instead, I will need to use addstr()
>and getstr(). Not too bad.

you can use c{in,out}, but you shouldnt. screws up curses something
big.

alternately you could just overload cout and cin to use curses
routines, shouldnt be too difficult, and probably pretty cool.

btw, curses has c++ lib that it comes with, but ive never used it, so
i cant help you there.
-- 
Brian Cully	bjc@panix.com	| "You can tune a filesystem, but you can't
System Administrator		|  tune a fish"
PANIX Public Access Networks	|			-- tunefs(8)
Re: Character Graphics, g++, and curses
#935
Author: Scott Murman
Date: Fri, 29 Mar 1996 01:24
19 lines
1193 bytes
According to Brian Joseph Cully <bjc@panix.com>:
>
>>I am planning on using curses to control the screen.
>>While this should do the trick, it will not allow me
>>to use cin and cout (I think!?!) for my user interface
>>screen object.  Instead, I will need to use addstr()
>>and getstr(). Not too bad.
>
>
>btw, curses has c++ lib that it comes with, but ive never used it, so
>i cant help you there.

I put my curses interface for C++ into the public domain some time
ago.  It's still supported, and I will release a new version with
colors, and some other geegaws, sooner than later.  It definately
compiles with g++2.7.2, and at least a few people are using it for
development work.  Enjoy.

http://www.best.com/~smurman/Drat/
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads