<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Does  al_load_bitmap_f work</title>
		<link>http://www.allegro.cc/forums/view/617136</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 15 Nov 2017 18:49:52 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Initially I thought it was a problem with Allegro.pas, but I did some testing with C and I have the same problem:  it returns NULL.</p><p>I&#39;m using Linux Xubuntu 16.04.3 updated and latest Allegro 5.2.3.</p><p>To reproduce the problem, get the ex_bitmap.c example and just add this at the beginning:</p><div class="source-code snippet"><div class="inner"><pre>  <a href="http://www.allegro.cc/manual/ALLEGRO_FILE"><span class="a">ALLEGRO_FILE</span></a> <span class="k3">*</span>lFile <span class="k3">=</span> NULL<span class="k2">;</span>
</pre></div></div><p>
Then search the line &quot;bitmap = al_load_bitmap(filename);&quot; and change it:
</p><div class="source-code snippet"><div class="inner"><pre><span class="c">/*</span>
<span class="c">    bitmap = al_load_bitmap(filename);</span>
<span class="c"> */</span>
    lFile <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a> <span class="k2">(</span>filename, <span class="s">"r"</span><span class="k2">)</span><span class="k2">;</span>
    bitmap <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_bitmap_f"><span class="a">al_load_bitmap_f</span></a> <span class="k2">(</span>lFile, filename<span class="k2">)</span><span class="k2">;</span>
    <a href="http://www.allegro.cc/manual/al_fclose"><span class="a">al_fclose</span></a> <span class="k2">(</span>lFile<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
AFAIK it should work, but it didn&#39;t. Debugging with GDB it says in function al_load_bitmap_flags_f that &quot;h&quot; is NULL.  Didn&#39;t look deeper.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Niunio)</author>
		<pubDate>Tue, 14 Nov 2017 22:54:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Judging by a quick look at the source, the string argument should no longer be the filename, but the result of al_identify_bitmap or al_identify_bitmap_f - possibly the file extension but I&#39;m not sure. Does that help?</p><p>[EDIT]<br />Yep, canonical extension with dot - see <a href="http://liballeg.org/a5docs/trunk/graphics.html#al_identify_bitmap_f">here</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Perry)</author>
		<pubDate>Wed, 15 Nov 2017 01:39:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Did a test (in Pascal) and didn&#39;t work.  <s>I can&#39;t do the test in C now but I will.</s>  </p><p>[edit]<br />Tested in C and it works.  Then I find the problem with Pascal:  the destination buffer pointer wasn&#39;t used properly.  Now it works. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /><br />[/edit]</p><p>Anyway, the problem seems that Mr. Silly Me didn&#39;t read the documentation. <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Niunio)</author>
		<pubDate>Wed, 15 Nov 2017 18:49:52 +0000</pubDate>
	</item>
</rss>
