<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[Allegro 5] Loading resources from memory</title>
		<link>http://www.allegro.cc/forums/view/614549</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 13 Aug 2014 09:50:42 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello everyone!</p><p>I have a question for you guys. In the game I am creating, I am using PAK files like those in Quake to store all of my game data into one single file for convinience and security. When the program is furst run it parses the PAK file. It&#39;s structure is similar to that of a UNIX file system. But that is not important. The files are stored as is, without compression. I read the files in buffers in memory. </p><p>How would I for example load a png image into allegro from a memory buffer (the buffer contains the entire png file, not just the pixel data, ex header and etc...)? <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" /></p><p>PS: Okay I was searching through the allegro documentation and stumbled upon this function:  </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_FILE"><span class="a">ALLEGRO_FILE</span></a> <span class="k3">*</span><a href="http://www.allegro.cc/manual/al_open_memfile"><span class="a">al_open_memfile</span></a><span class="k2">(</span><span class="k1">void</span> <span class="k3">*</span>mem, <span class="k1">int64_t</span> size, <span class="k1">const</span> <span class="k1">char</span> <span class="k3">*</span>mode<span class="k2">)</span>
</div></div><p>

From what I understand this should create an ALLEGRO_FILE handle to a virtual file in memory. I can then use al_load_bitmap_f with the returned handle to load the bitmap from memory. Is that correct? <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Juxxec)</author>
		<pubDate>Tue, 12 Aug 2014 13:58:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="https://www.allegro.cc/forums/thread/613273/990154#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>You can open a chunk of memory using the al_open_memfile function from the memfile addon. then you can use the al_load_bitmap_f function to load the image from an open file handle. </p></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Tue, 12 Aug 2014 14:05:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh thank you <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Juxxec)</author>
		<pubDate>Tue, 12 Aug 2014 14:10:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Someone mentioned a solution similar to what you said <a href="https://www.allegro.cc/forums/thread/614530">here</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Wed, 13 Aug 2014 09:50:42 +0000</pubDate>
	</item>
</rss>
