<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>A5 colour depth and colours in general</title>
		<link>http://www.allegro.cc/forums/view/606420</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 17 Feb 2011 00:20:02 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello,<br />Sorry I&#39;m late to the A5 party. A few questions on colours and depth:</p><p>1. How do you specify what depth you want (i.e. the old set_color_depth)?<br />2. Where are the colour conversion functions (i.e. set_color_conversion), such as converting 32bit to 16bit?<br />3. I take it paletted bitmaps and 8bit is not supported. How do you read 8bpp images?<br />4. What about seeing what we&#39;ve got (e.g. stuff like gfx_capabilities to check for hardware acceleration, the current bitmap depth, etc)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Wed, 16 Feb 2011 22:55:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606420/903772#target">Neil Walker</a> said:</div><div class="quote"><p>
1. How do you specify what depth you want (i.e. the old set_color_depth)?
</p></div></div><p>

<span class="source-code"><a href="http://www.allegro.cc/manual/al_set_new_display_option"><span class="a">al_set_new_display_option</span></a></span></p><p>Specifically ALLEGRO_COLOR_SIZE, ALLEGRO_RED_SIZE, GREEN_SIZE, BLUE_SIZE.</p><p>Generally you don&#39;t have to worry about RED/GREEN/BLUE size, or even color size, but if you just want a 16 bit backbuffer use ALLEGRO_COLOR_SIZE.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
2. Where are the colour conversion functions (i.e. set_color_conversion), such as converting 32bit to 16bit?
</p></div></div><p>

Loaded bitmaps are automatically converted to the current format set by <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_new_bitmap_format"><span class="a">al_set_new_bitmap_format</span></a></span>.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
3. I take it paletted bitmaps and 8bit is not supported. How do you read 8bpp images?
</p></div></div><p>

You can load 8bpp images, they will be converted to the format set by al_set_new_bitmap_format as above. There are no 8bpp ALLEGRO_BITMAPs or ALLEGRO_DISPLAYs.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Wed, 16 Feb 2011 23:14:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks. That was easy <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>So, looking at the bitmap methods, when you create bitmaps, etc without specifying flags do they get set to the display depth (e.g. ALLEGRO_COLOR_SIZE) or some other default?</p><p>btw, I&#39;m converting a library that relied on allegro being initialised and configured and used &#39;screen&#39; to see if allegro was configured. What&#39;s the best way in A5, now it has no globals? Just call a display option (e.g. get backbuffer) and see if it returns NULL</p><p>One more thing, what&#39;s the easiest way of checking a colour matches, I used to do something like:</p><p>if(get_pixel(....)==makecol(1,2,3)</p><p>but colours now work with structs. I&#39;m sure I could write a function but am asking anyway.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Wed, 16 Feb 2011 23:35:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606420/903774#target">Neil Walker</a> said:</div><div class="quote"><p>I&#39;m converting a library that relied on allegro being initialised and configured and used &#39;screen&#39; to see if allegro was configured. What&#39;s the best way in A5, now it has no globals? Just call a display option (e.g. get backbuffer) and see if it returns NULL</p></div></div><p>
I doubt that&#39;d work. Fortunately, there is <span class="source-code"><a href="http://www.allegro.cc/manual/al_is_system_installed"><span class="a">al_is_system_installed</span></a><span class="k2">(</span><span class="k2">)</span></span> <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>but colours now work with structs. I&#39;m sure I could write a function but am asking anyway.</p></div></div><p>
Writing a function is probably the way to go.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Thu, 17 Feb 2011 00:00:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks again. I never spotted that <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>One thing I&#39;m trying to achieve and I hope this is my last question, is the equivalent of:</p><p>blit (source, dest, sx, sy, dx, dy, w, h);</p><p>i.e. al_draw_bitmap seems to only copy full width and height. I take it you have to create a sub-bitmap first in order to blit only part of a bitmap onto another? If so, wouldn&#39;t it be more useful to just have a function to do this as I assume it&#39;s a very common thing to do?</p><p>It&#39;s getting quite lengthy my code. I&#39;m doing some parallax stuff and assuming you have to first create sub-bitmaps, it&#39;s doubling the code. Then I want to draw the bitmap onto itself which it seems you cannot do in A5 now, so that&#39;s yet more code to create temporary bitmaps, etc.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Thu, 17 Feb 2011 00:15:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_bitmap_region"><span class="a">al_draw_bitmap_region</span></a><span class="k2">(</span><span class="k2">)</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Thu, 17 Feb 2011 00:18:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Crikey, I&#39;ve got the eyesight of a donkey.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Thu, 17 Feb 2011 00:20:02 +0000</pubDate>
	</item>
</rss>
