Welcome to GameHourz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Colors in pdcurses vs. ncurses

 
   Game Forums (Home) -> Roguelike -> Development RSS
Related Topics:
ncurses in windows - My code won't compile under windows, quite obviously because I don't have ncurses However, ncurses seems to be only for Linux. Is there some windows

Problems with PDcurses - I'd like to preface this by saying that I am VERY new to the roguelike scene, so I'm trying to learn most of this as I go. I just picked up a copy of PDcurses, and I've been with it. addch() , addstr() and getch() seem to be..

init_color() in PDCurses - OK, along with the X11 and DOS ports, the Win32 port of PDCurses now has a working and You can try it out now via anonymous CVS; otherwise you'll have to wait for the next release. in the Win32 port: 1) Works..

ncurses, c: keypad-home & keypad-end don't work properly - Hi, I have the following c code that determins user input for movment: switch (getch()) { case KEY_UP: break; case KEY_DOWN: break; case KEY_LEFT: break; ..

PDcurses incompatibility with fstream.h? - Okay, this is probably more of my lack of of C++ than anything else, but here goes. I'm writing a I've gotten it to the point where the player can move around, look, and doors, and I was gearing towards..
Next:  7DRL Challenge 2008: Date is Chosen!  
Author Message
Ido Yehieli

External


Since: Nov 29, 2007
Posts: 75



(Msg. 1) Posted: Fri Feb 01, 2008 1:58 am
Post subject: Colors in pdcurses vs. ncurses
Archived from groups: rec>games>roguelike>development (more info?)

Hi,
I've noticed that the default color macros in pdcurses (BGR) are
not the same as the default in ncurses (RGB):

ncurses:
COLOR_BLACK = 0
COLOR_RED
COLOR_GREEN
COLOR_YELLOW
COLOR_BLUE
COLOR_MAGENTA
COLOR_CYAN
COLOR_WHITE = 7

pdcurses:
#define COLOR_BLACK 0
#ifdef PDC_RGB /* RGB */
# define COLOR_RED 1
# define COLOR_GREEN 2
# define COLOR_BLUE 4
#else /* BGR */
# define COLOR_BLUE 1
# define COLOR_GREEN 2
# define COLOR_RED 4
#endif
#define COLOR_CYAN (COLOR_BLUE | COLOR_GREEN)
#define COLOR_MAGENTA (COLOR_RED | COLOR_BLUE)
#define COLOR_YELLOW (COLOR_RED | COLOR_GREEN)
#define COLOR_WHITE 7


If no definition is made by the user the same program will look
different when including pdcurses' <xcurses.h> than when <ncurses.h>
is included.

-Ido.

 >> Stay informed about: Colors in pdcurses vs. ncurses 
Back to top
Login to vote
"Ulf_Åström

External


Since: Jan 27, 2008
Posts: 31



(Msg. 2) Posted: Fri Feb 01, 2008 2:39 am
Post subject: Re: Colors in pdcurses vs. ncurses [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 1 Feb, 10:58, Ido Yehieli <Ido.Yehi....TakeThisOut@gmail.com> wrote:
>      I've noticed that the default color macros in pdcurses (BGR) are
> not the same as the default in ncurses (RGB):
>
> If no definition is made by the user the same program will look
> different when including pdcurses' <xcurses.h> than when <ncurses.h>
> is included.

Have you tested this? The values might be treated in different ways
internally. I assume you link with the library corresponding to the
included header.

-the ru

 >> Stay informed about: Colors in pdcurses vs. ncurses 
Back to top
Login to vote
Ido Yehieli

External


Since: Nov 29, 2007
Posts: 75



(Msg. 3) Posted: Fri Feb 01, 2008 2:51 am
Post subject: Re: Colors in pdcurses vs. ncurses [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Feb 1, 11:39 am, "Ulf Åström" <ulf.ast....DeleteThis@gmail.com> wrote:
> Have you tested this? The values might be treated in different ways
> internally. I assume you link with the library corresponding to the
> included header.

Of course I tested it - I looked in the .h file only after I got
different colors in my game Smile

The libs were each linked with their own header. pdcurses linked with
ncurses' header results in no color support.

-Ido.
 >> Stay informed about: Colors in pdcurses vs. ncurses 
Back to top
Login to vote
"Ulf_Åström

External


Since: Jan 27, 2008
Posts: 31



(Msg. 4) Posted: Fri Feb 01, 2008 4:04 am
Post subject: Re: Colors in pdcurses vs. ncurses [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 1 Feb, 11:51, Ido Yehieli <Ido.Yehi....TakeThisOut@gmail.com> wrote:
> On Feb 1, 11:39 am, "Ulf Åström" <ulf.ast....TakeThisOut@gmail.com> wrote:
>
> > Have you tested this? The values might be treated in different ways
> > internally. I assume you link with the library corresponding to the
> > included header.
>
> Of course I tested it - I looked in the .h file only after I got
> different colors in my game Smile

A-ha - I see now that I misunderstood the original post. Never mind.

Pardon my scepticism, I was just trying to prevent the spread of
potentially incorrect information. Wink

-the ru
 >> Stay informed about: Colors in pdcurses vs. ncurses 
Back to top
Login to vote
William McBrine

External


Since: Apr 02, 2006
Posts: 12



(Msg. 5) Posted: Fri Feb 01, 2008 4:45 pm
Post subject: Re: Colors in pdcurses vs. ncurses [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 01 Feb 2008 01:58:51 -0800, Ido Yehieli wrote:

> If no definition is made by the user the same program will look
> different when including pdcurses' <xcurses.h> than when <ncurses.h> is
> included.

It won't, if you consistently refer to colors by their symbolic names
(COLOR_BLACK, etc.), which is the recommended practice. If you want to
refer to colors by number, and have them look the same with ncurses and
PDCurses, then yes, you should probably define PDC_RGB when building both
the library and your app.

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
 >> Stay informed about: Colors in pdcurses vs. ncurses 
Back to top
Login to vote
Timofei Shatrov

External


Since: Nov 22, 2004
Posts: 250



(Msg. 6) Posted: Fri Feb 01, 2008 11:42 pm
Post subject: Re: Colors in pdcurses vs. ncurses [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 1 Feb 2008 01:58:51 -0800 (PST), Ido Yehieli <Ido.Yehieli RemoveThis @gmail.com>
tried to confuse everyone with this message:

>Hi,
> I've noticed that the default color macros in pdcurses (BGR) are
>not the same as the default in ncurses (RGB):

Yeah, I noticed that when I ported my games to Linux. Since it's not
possible to get the #define constants out of a dynamic library, it's
somewhat of an inconvenience. There are a lot of other inconsistencies
as well.

--
|Don't believe this - you're not worthless ,gr---------.ru
|It's us against millions and we can't take them all... | ue il |
|But we can take them on! | @ma |
| (A Wilhelm Scream - The Rip) |______________|
 >> Stay informed about: Colors in pdcurses vs. ncurses 
Back to top
Login to vote
Ray Dillinger

External


Since: Jun 01, 2004
Posts: 260



(Msg. 7) Posted: Sat Feb 02, 2008 2:59 am
Post subject: Re: Colors in pdcurses vs. ncurses [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ido Yehieli wrote:

> Hi,
> I've noticed that the default color macros in pdcurses (BGR) are
> not the same as the default in ncurses (RGB):
>

This is why these constants have names. Use the same name, and you get
the same color.

Bear
 >> Stay informed about: Colors in pdcurses vs. ncurses 
Back to top
Login to vote
Display posts from previous:   
   Game Forums (Home) -> Roguelike -> Development All times are: Ekaterinburg, Islamabad, Karachi, Tashkent (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]