nanogui: Problem with GC_MODE


Previous by date: 26 Sep 2007 16:11:40 +0100 Problem with GC_MODE, Carlo Zinato
Next by date: 26 Sep 2007 16:11:40 +0100 Re: timer not working fixed, at least for now, I think., Martin Kajdas
Previous in thread: 26 Sep 2007 16:11:40 +0100 Problem with GC_MODE, Carlo Zinato
Next in thread:

Subject: Re: [nanogui] Problem with GC_MODE
From: Carlo Zinato ####@####.####
Date: 26 Sep 2007 16:11:40 +0100
Message-Id: <46FA76A4.1020209@viscount.it>

Carlo Zinato ha scritto:
> Hi all,
> 
> I'm using a  truecolor 565 color framebuffer drawing graphics 
> exclusively in black and white, i.e. with GrSetGCBackground(gc, WHITE) 
> and GrSetGCForeground(gc, BLACK). Everything works fine in GR_MODE_COPY 
> and GR_MODE_COPYINVERTED (involving only src graphic), but when I use 
> any other mode which combines src and dst nothing is drawn. For example 
> if I draw in GR_MODE_XOR mode a black box somewhere over a bigger black 
> box nothing happens. Am I missing something?

OK, I misunderstood how GR_MODE works: I thought logical operations 
consider foreground as 1 and background as 0. But they refer to actual 
pixel colors, so in my case WHITE is 1 (pixel is 0xFFFF) and BLACK is 0 
(pixel is 0x0000).
Solved problem inverting the logic (e.g. replaced GR_MODE_XOR with 
GR_MODE_EQUIV).

Cheers,
Carlo

> 
> Thanks in advande,
> Carlo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
> 
> 
> 

Previous by date: 26 Sep 2007 16:11:40 +0100 Problem with GC_MODE, Carlo Zinato
Next by date: 26 Sep 2007 16:11:40 +0100 Re: timer not working fixed, at least for now, I think., Martin Kajdas
Previous in thread: 26 Sep 2007 16:11:40 +0100 Problem with GC_MODE, Carlo Zinato
Next in thread:


Powered by ezmlm-browse 0.20.