delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/27/17:16:29

From: gautam AT interlog DOT com (Gautam N. Lad)
Newsgroups: comp.os.msdos.djgpp
Subject: Problem with XOR (Allegro)
Date: Mon, 27 Oct 97 16:03:37 GMT
Organization: InterLog Internet Services
Lines: 37
Message-ID: <632dgn$o5m$2@news.interlog.com>
NNTP-Posting-Host: ip213-65.cc.interlog.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,
Ok, I've a palette in a Datafile, which I load up when my program runs.  The 
colours are defined so I don't have to use numbers.   Like so:

#define YELLOW	5
#define WHITE	4
#define XOR_ON	xor_mode(-1);
#define XOR_OFF	xor_mode(0);

circle(screen, 100, 200, 5, YELLOW);

Now, I have a problem.  It seems that when I turn XOR enabled, the colours 
value seem a bit differnet.  What I mean is, if I draw using YELLOW, the colour 
WHITE (index in palette of 4 in my case) get's used.  Is this how XOR 
works?  I'm pretty sure, but I don't think it should change the colour I'm drawing 
with.  Now, this is on a background colour (index value of 0 in palette), with 
nothing on it.  It seems the colour being used is one less then what I want.

I do something like this:

XOR_ON;
	circle(screen, 100, 200, 5, YELLOW);
XOR_OFF;

The result is a WHITE circle.

Any ideas?
Bye!

-------------------------------------------------------------
Gautam N. Lad
-------------------------------------------------------------
E-Mail:	gautam AT interlog DOT com
Website:	http://www.interlog.com/~gautam

POV-Ray Software, Gallery, and Links!
-------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019