<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>colours changes after graphics mode!</title>
		<link>http://www.allegro.cc/forums/view/588315</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 04 Nov 2006 00:51:39 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi all! In my program I read from a config file colours and settings and then I start graphics system. After a deep debug I&#39;ve noticed colours made before graphics system are changed red and blue! see:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k2">{</span>
...
<span class="c">// for example</span>
colour <span class="k3">=</span> <a href="http://www.allegro.cc/manual/makecol24" target="_blank"><span class="a">makecol24</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
...
<a href="http://www.allegro.cc/manual/allegro_init" target="_blank"><span class="a">allegro_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/set_color_depth" target="_blank"><span class="a">set_color_depth</span></a><span class="k2">(</span><span class="n">24</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a><span class="k2">(</span>...<span class="k2">)</span><span class="k2">;</span>
...
<a href="http://www.allegro.cc/manual/al_trace" target="_blank"><span class="a">al_trace</span></a><span class="k2">(</span><span class="s">"%d %d %d"</span>,<a href="http://www.allegro.cc/manual/getr24" target="_blank"><span class="a">getr24</span></a><span class="k2">(</span>color<span class="k2">)</span>,<a href="http://www.allegro.cc/manual/getg24" target="_blank"><span class="a">getg24</span></a><span class="k2">(</span>color<span class="k2">)</span>,<a href="http://www.allegro.cc/manual/getb24" target="_blank"><span class="a">getb24</span></a><span class="k2">(</span>color<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
and now colour is (0,0,255). I&#39;ve tried to call set_color_depth() before makecol24() with no success. Do you know why this happens or how to solve it? Don&#39;t want to make a function to interchange red and blue, neither use 3 ints instead of 1 to keep rgb and then create colour. Thanks indeed!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Maikol)</author>
		<pubDate>Wed, 01 Nov 2006 18:43:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Allegro doesn&#39;t know the color ordering of a graphics mode before the mode is set, so it guesses some defaults. After setting the graphics mode, the color ordering is properly read from the system, which may be different from before setting the mode.</p><p>Also, any particular reason for 24-bit? 32-bit is generally faster. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Wed, 01 Nov 2006 18:53:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I use 24 bit because my graphic card isn&#39;t able to load 32 bit at high resolutions and because I like using only rgb, no more parameters.</p><p>All told I must set graphics and then create colours. Then I&#39;ll have to use 3 ints... but maybe one day I&#39;d like to use 32 bits! Pfff okay, I&#39;ll manage. Thanks!!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Maikol)</author>
		<pubDate>Wed, 01 Nov 2006 19:05:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>32-bit runs the same as 24-bit, it just allows for fullscreen and takes a little more room. I don&#39;t believe allegro uses the last 8 bits at all in 32-bit mode. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kikaru)</author>
		<pubDate>Sat, 04 Nov 2006 00:32:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I don&#39;t believe allegro uses the last 8 bits at all in 32-bit mode.
</p></div></div><p>
You&#39;ve never heard of an alpha channel, have you?</p><p>EDIT: also, 24 or 32 bit has nothing to do with being able to run in Windowed mode or not. That said, Allegro will always run in the desktop colourdepth if you&#39;re using a window, so setting the colourdepth to something else forces colour conversions at each update.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sat, 04 Nov 2006 00:51:39 +0000</pubDate>
	</item>
</rss>
