<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>AllegroGL: How to make textures from datafile-bitmaps?</title>
		<link>http://www.allegro.cc/forums/view/589511</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 10 Jan 2007 20:00:30 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have the following question: Why does </p><p>    texture_id = allegro_gl_make_texture ((BITMAP *)dat[SOME_BITMAP].dat);</p><p>results in a very dark (almost black) texture whereas</p><p>    bmp = load_bitmap(&quot;some_bitmap.pcx&quot;,pal);<br />    texture_id = allegro_gl_make_texture (bmp);</p><p>works fine although dat[SOME_BITMAP] is the grabbed file &quot;some_bitmap.pcx&quot;. <br />What am i missing?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (maxx.t)</author>
		<pubDate>Wed, 10 Jan 2007 15:46:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Have you set color depth, graphics mode, color conversion etc. before loading the datafile?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Wed, 10 Jan 2007 15:49:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I loaded the datafile before setting up the graphic mode.</p><p>Loading the datafile after the graphics setup results in the right intensitiy <br />of the texture. However, now the wrong palette is used for drawing. This holds for the texture and also if I use the loaded bitmap for blitting in allegro mode.</p><p>Changing the color depth to the one of the bitmap (8 bit) or using set_palette() <br />with the related palette of the bitmap does not help.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (maxx.t)</author>
		<pubDate>Wed, 10 Jan 2007 16:18:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>why not just save the image as an rgb rather than paletted image?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Wed, 10 Jan 2007 18:27:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Due to the way 8-bit images are stored in datafiles, you&#39;ll have to load and set the proper palette before loading the datafile. So:
</p><ol><li><p>Set color depth and graphics mode.</p></li><li><p>Load the proper palette with <span class="source-code"><a href="http://www.allegro.cc/manual/load_datafile_object" target="_blank"><span class="a">load_datafile_object</span></a><span class="k2">(</span><span class="k2">)</span></span> and set it.</p></li></ol><p>&lt;/li&gt;
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Wed, 10 Jan 2007 18:37:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank you very much! <br />Both solutions are working fine.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (maxx.t)</author>
		<pubDate>Wed, 10 Jan 2007 20:00:30 +0000</pubDate>
	</item>
</rss>
