<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>al_register_bitmap_loader( &quot;.ext&quot;, ?*(*al_loader_fnxn)? )</title>
		<link>http://www.allegro.cc/forums/view/615593</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 29 Jul 2015 20:35:00 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The title refers to the unknown second argument desired by the al_register_bitmap_loader() function. In fact, the documentation and the MSVS snippet auto-completer disagree on exactly what it wants, the former designating an &quot;ALLEGRO_BITMAP *(*loader)(const char *filename)&quot;; the latter demanding an &quot;ALLEGRO_IIO_LOADER_FUNCTION loader&quot;. I assume that these types are identical, though how this is so is beyond my ken, and all attempts to satisfy the wanton desires of this function have proven fruitless. </p><p>So I am asking for someone to explain in clear terms the reason why this function was implemented and how to provide it an argument which allows me to make use of it. ( I am aware that the NULL pointer allows you to compile without error, but it still precludes actual use of it to load bitmaps, which is the whole idea. )
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Durendal)</author>
		<pubDate>Mon, 27 Jul 2015 19:54:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;d assume you just need to pass it any pointer to a function that returns and ALLEGRO_BITMAP* while taking a const char*. This would make most sense, if you think about it.</p><p>As an example:</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a><span class="k3">*</span> load_psd_file<span class="k2">(</span><span class="k1">const</span> <span class="k1">char</span><span class="k3">*</span> filename<span class="k2">)</span>
<span class="number">  2</span><span class="k2">{</span>
<span class="number">  3</span>    <span class="c">/* Code for loading a PSD file here */</span>
<span class="number">  4</span><span class="k2">}</span>
<span class="number">  5</span>
<span class="number">  6</span><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span>
<span class="number">  7</span><span class="k2">{</span>
<span class="number">  8</span>    <span class="c">/* Allegro initialization code here */</span>
<span class="number">  9</span>
<span class="number"> 10</span>    <a href="http://www.allegro.cc/manual/al_register_bitmap_loader"><span class="a">al_register_bitmap_loader</span></a><span class="k2">(</span><span class="s">".psd"</span>, <span class="k3">&amp;</span>load_psd_file<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 11</span>
<span class="number"> 12</span>    <a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a><span class="k3">*</span> bitmap <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_bitmap"><span class="a">al_load_bitmap</span></a><span class="k2">(</span><span class="s">"GameDataFolder/MyTestBitmap.psd"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 13</span>
<span class="number"> 14</span>    <span class="c">/* Draw bitmap to screen here */</span>
<span class="number"> 15</span>
<span class="number"> 16</span>    <span class="c">/* Free resources here */</span>
<span class="number"> 17</span>
<span class="number"> 18</span>    <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 19</span><span class="k2">}</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (RPG Hacker)</author>
		<pubDate>Tue, 28 Jul 2015 16:20:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank you for the help! It has kicked the ball further down the field. I do have a resulting problem I would like to know the answer to, however: namely, Doesn&#39;t allegro supply the code for loading images? If this is so, I must be using the wrong method of loading them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Durendal)</author>
		<pubDate>Wed, 29 Jul 2015 20:02:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, it has code for a few image formats included already, such as png. You have to init the image addon to use them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (RPG Hacker)</author>
		<pubDate>Wed, 29 Jul 2015 20:35:00 +0000</pubDate>
	</item>
</rss>
