<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>load_bitmap not working</title>
		<link>http://www.allegro.cc/forums/view/590264</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 26 Feb 2007 20:34:25 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I really hate asking this question because this seems like some little bug that&#39;s probably been posted a few dozen times. Either way, relevant code. The load_bitmap is returning null. I&#39;m using MSVC 2005 pro edition. I put the images folder under the project folder and in it is a title.bmp file, would it be looking for the file somewhere else by any chance?
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k1">void</span> main<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span></td></tr><tr><td class="number">2</td><td><span class="k2">{</span></td></tr><tr><td class="number">3</td><td>  setup<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">4</td><td>  </td></tr><tr><td class="number">5</td><td>        <a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>title<span class="k3">=</span>NULL<span class="k2">;</span></td></tr><tr><td class="number">6</td><td>        title <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"images/title.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">7</td><td>  <span class="k1">bool</span> test<span class="k3">=</span><span class="k1">false</span><span class="k2">;</span></td></tr><tr><td class="number">8</td><td>  <span class="k1">while</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_ESC<span class="k2">]</span><span class="k2">)</span></td></tr><tr><td class="number">9</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">10</td><td>    <span class="k1">if</span><span class="k2">(</span>title<span class="k3">!</span><span class="k3">=</span>NULL<span class="k2">)</span></td></tr><tr><td class="number">11</td><td>    <span class="k2">{</span></td></tr><tr><td class="number">12</td><td>      <a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,title,<span class="n">250</span>,<span class="n">250</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">14</td><td>    </td></tr><tr><td class="number">15</td><td>    <a href="http://www.allegro.cc/manual/rest" target="_blank"><span class="a">rest</span></a><span class="k2">(</span><span class="n">120</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">16</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">17</td><td>  <a href="http://www.allegro.cc/manual/destroy_bitmap" target="_blank"><span class="a">destroy_bitmap</span></a><span class="k2">(</span>title<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">18</td><td>        <a href="http://www.allegro.cc/manual/allegro_exit" target="_blank"><span class="a">allegro_exit</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">19</td><td><span class="k2">}</span></td></tr><tr><td class="number">20</td><td><a href="http://www.allegro.cc/manual/END_OF_MAIN" target="_blank"><span class="a">END_OF_MAIN</span></a><span class="k2">(</span><span class="k2">)</span></td></tr></tbody></table></div></div><p>
and for those wondering setup does the following...
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">void</span> setup<span class="k2">(</span><span class="k2">)</span>
<span class="k2">{</span>
  <a href="http://www.allegro.cc/manual/set_color_depth" target="_blank"><span class="a">set_color_depth</span></a><span class="k2">(</span><span class="n">16</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/set_color_conversion" target="_blank"><span class="a">set_color_conversion</span></a><span class="k2">(</span><span class="n">16</span><span class="k2">)</span><span class="k2">;</span>
        <a href="http://www.allegro.cc/manual/allegro_init" target="_blank"><span class="a">allegro_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/install_keyboard" target="_blank"><span class="a">install_keyboard</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/install_mouse" target="_blank"><span class="a">install_mouse</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
        setup_screen<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/show_mouse" target="_blank"><span class="a">show_mouse</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
and setup screen does
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">void</span> setup_screen<span class="k2">(</span><span class="k2">)</span>
<span class="k2">{</span>
  <span class="k1">int</span> ret<span class="k3">=</span><a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a><span class="k2">(</span>GFX_AUTODETECT_WINDOWED,<span class="n">1024</span>,<span class="n">768</span>,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
  <span class="k1">if</span> <span class="k2">(</span>ret<span class="k3">!</span><span class="k3">=</span><span class="n">0</span><span class="k2">)</span>
  <span class="k2">{</span>
    <a href="http://www.allegro.cc/manual/allegro_message" target="_blank"><span class="a">allegro_message</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/allegro_error" target="_blank"><span class="a">allegro_error</span></a><span class="k2">)</span><span class="k2">;</span>
    <span class="k1">return</span><span class="k2">;</span>
  <span class="k2">}</span>
  textprintf<span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,<a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>,<span class="n">1</span>,<span class="n">1</span>,<a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">189</span>,<span class="n">73</span><span class="k2">)</span>,<span class="s">"Extreme Racing - %dx%d"</span>,<span class="n">1024</span>,<span class="n">768</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,<span class="n">0</span>,<span class="n">12</span>,<span class="n">1023</span>,<span class="n">767</span>,<a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">242</span>,<span class="n">169</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,<span class="n">1</span>,<span class="n">13</span>,<span class="n">1022</span>,<span class="n">765</span>,<a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">242</span>,<span class="n">169</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

Edit: i actually had an end of main.;D Sorry about the lack of formatting, used to devnetwork.net which has a button to click for code editing. My mistake. :-D I am clicking the debug button which means it&#39;s supposed to look in the project folder.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Charles256)</author>
		<pubDate>Mon, 26 Feb 2007 03:54:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="http://www.allegro.cc/mockup.html">Read this before posting code</a></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
would it be looking for the file somewhere else by any chance?
</p></div></div><p>Are you using Debug-&gt;Start Without Debugging, or double clicking on the EXE? In the case of the former, it will look under the project folder. In the case of the latter, it will look for project/Debug/images/title.bmp.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Mon, 26 Feb 2007 04:00:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Edit your post with code tags so it&#39;s actually readable. Click the &quot;Help&quot; icon for info.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I put the images folder under the project folder and in it is a title.bmp file, would it be looking for the file somewhere else by any chance?
</p></div></div><p>
Check the working directory for your project.</p><p>Also, &quot;void main&quot; is an illegal construction, and you lack an END_OF_MAIN(). That&#39;s all I&#39;m willing to read in the unformatted code.</p><p>[EDIT]<br />DAMN YOU, CGAMESPLAY! <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Mon, 26 Feb 2007 04:00:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Doh. You said in unformatted code. At first I took it as a strike upon my spacing. :-D Which is a bit off with the code tags... Oh well.. Sorry. :-D Honest, I know c++. Only reason I used a void main is because of the book I&#39;m using to learn allegro. I normally do a good ole standard int main(){ return 0;} format but since the code didn&#39;t work the first time through I made the code more and more like the book so I could eliminate assumption errors.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Charles256)</author>
		<pubDate>Mon, 26 Feb 2007 04:08:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Only reason I used a void main is because of the book I&#39;m using to learn allegro.
</p></div></div><p>
... it&#39;s &quot;Game Programming All In One&quot;, isn&#39;t it? <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>Anyway, on to the code:<br />First off, as a general rule, don&#39;t call <i>any</i><sup>*</sup> Allegro functions before allegro_init(). It might be safe in this case, but in others your program might die a horrible death.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
set_color_conversion(16);
</p></div></div><p>
That&#39;s not how you do it. It possibly does something useful, but even in that case it&#39;s unreadable: set_color_conversion() takes as its argument an bitfield with your choice of conversion modes ORed together.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
textprintf
</p></div></div><p>
textprintf() is deprecated. Use <span class="source-code"><a href="http://www.allegro.cc/manual/textprintf_ex" target="_blank"><span class="a">textprintf_ex</span></a><span class="k2">(</span><span class="k2">)</span></span> instead. </p><p>Other than that it looks ok. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><ul><li><p><sub>the exception being set_uformat()</sub>
</p></li></ul></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Mon, 26 Feb 2007 05:56:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>yep. looks just fine, doesn&#39;t it? It&#39;s still not working though..... help? <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Charles256)</author>
		<pubDate>Mon, 26 Feb 2007 06:13:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, how do you start your program? And what are your working directory settings in MSVS?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Mon, 26 Feb 2007 06:23:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Does it load the file correctly if you give the full path name?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Mon, 26 Feb 2007 06:27:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>See if the attached file works, it only has minor changes to the code you originally gave.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (someone972)</author>
		<pubDate>Mon, 26 Feb 2007 06:29:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I start the program by starting debugging which means it should search under my project folder for the image. And what do you mean by working directory settings? Been programming in c++ for a bit but it&#39;s all been command line stuff that very rarely acts this poorly so you&#39;ll have to forgive me. :-D Be a bit more specific and I&#39;ll dig up the info for you.</p><p>edit: the attached file did not work and even if I give the full path name it does not load teh file however I can load the file in any old image viewer.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Charles256)</author>
		<pubDate>Mon, 26 Feb 2007 06:31:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Are you linking with -lalleg or -lalld, it might not even make a difference.<br />Oh ok.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (someone972)</author>
		<pubDate>Mon, 26 Feb 2007 06:47:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>i have an additional dependency of alld.lib
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Charles256)</author>
		<pubDate>Mon, 26 Feb 2007 06:55:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>someone972: As I&#39;ve said to others: if you have absolutely no idea, keep silent. Incorrect linking would show up immediately as a linking error. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
And what do you mean by working directory settings?
</p></div></div><p>
Somewhere in the myriad settings in MSVS you can set the working directory (= the directory your executable starts in) for your project.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
the attached file did not work and even if I give the full path name it does not load teh file however I can load the file in any old image viewer.
</p></div></div><p>
How did you load it with the full path?<br />And could you attach the BMP? It might be some obscure or broken variant that Allegro just won&#39;t load.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Mon, 26 Feb 2007 07:01:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>this working directory, as you put it, as far as I can tell is the standard directory. all MSVC projects assume the project folder. there&#39;s two of em. the original one i tried to use is titled test now
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Charles256)</author>
		<pubDate>Mon, 26 Feb 2007 07:10:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Those BMPs are kosher. <br />Two things just (hey, I&#39;m tired <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />) occurred to me however:<br />1) You should be exiting with an error message if the bitmap doesn&#39;t load instead of just not drawing it - otherwise, it might actually be loaded and drawn but (due to, say, erroneous color conversion<sup>*</sup>) blend in with the background.<br />2) (Since you <i>do</i> have a habit of ignoring parts of posts <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />) ... you did change your call to set_color_conversion() to something proper, right? Drawing a non-8-bit BITMAP onto a different-depth-bit-BITMAP would be a Bad Thing<sup>TM</sup>.</p><ul><li><p><sub>cue dramatic foreshadowing music</sub>
</p></li></ul></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Mon, 26 Feb 2007 07:29:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you are running on Windows this: <span class="source-code"><a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"images/title.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></span><br />should be: <span class="source-code"><a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"images//title.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kikaru)</author>
		<pubDate>Mon, 26 Feb 2007 08:23:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
If you are running on Windows this:
</p></div></div><p>
What you are saying is false.</p><ol><li><p>Navigate to the directory containing your executable file</p></li><li><p>Ensure that the images directory is in this directory</p></li><li><p>Double click the executable</p></li></ol><p>

If load_bitmap is still returning NULL, you know the issue is something else.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Mon, 26 Feb 2007 08:52:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>current code. it&#39;s an 8 bit bmp. i am exiting with an error message if it doesn&#39;t load. because if it wasn&#39;t null it wouldn&#39;t get to the else. :-D i took out color conversion. I also went to the folder with the exe, ran it, and it still didn&#39;t load the file. Thanks for all the help guys but we&#39;re still short. Please help. I can program but if I can&#39;t get this working I&#39;ll have to do thigns the hard way and learn direct x  <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /></p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="p">#include &lt;allegro.h&gt;</span></td></tr><tr><td class="number">2</td><td>&#160;</td></tr><tr><td class="number">3</td><td><span class="k1">void</span> setup_screen<span class="k2">(</span><span class="k2">)</span></td></tr><tr><td class="number">4</td><td><span class="k2">{</span></td></tr><tr><td class="number">5</td><td>  <span class="k1">if</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a><span class="k2">(</span>GFX_AUTODETECT_WINDOWED,<span class="n">1024</span>,<span class="n">768</span>,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k3">!</span><span class="k3">=</span><span class="n">0</span><span class="k2">)</span></td></tr><tr><td class="number">6</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">7</td><td>    <a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a><span class="k2">(</span>GFX_TEXT,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">8</td><td>    <a href="http://www.allegro.cc/manual/allegro_message" target="_blank"><span class="a">allegro_message</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/allegro_error" target="_blank"><span class="a">allegro_error</span></a><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">9</td><td>    <a href="http://www.delorie.com/djgpp/doc/libc/libc_298.html" target="_blank">exit</a><span class="k2">(</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">10</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">11</td><td>  <a href="http://www.allegro.cc/manual/textprintf_ex" target="_blank"><span class="a">textprintf_ex</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,<a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>,<span class="n">1</span>,<span class="n">1</span>,<a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">189</span>,<span class="n">73</span><span class="k2">)</span>,<span class="n">0</span>,<span class="s">"Extreme Racing - %dx%d"</span>,<span class="n">1024</span>,<span class="n">768</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">12</td><td>  <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,<span class="n">0</span>,<span class="n">12</span>,<span class="n">1023</span>,<span class="n">767</span>,<a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">242</span>,<span class="n">169</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td>  <a href="http://www.allegro.cc/manual/rect" target="_blank"><span class="a">rect</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,<span class="n">1</span>,<span class="n">13</span>,<span class="n">1022</span>,<span class="n">765</span>,<a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">242</span>,<span class="n">169</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">14</td><td><span class="k2">}</span></td></tr><tr><td class="number">15</td><td>&#160;</td></tr><tr><td class="number">16</td><td><span class="k1">void</span> setup<span class="k2">(</span><span class="k2">)</span></td></tr><tr><td class="number">17</td><td><span class="k2">{</span></td></tr><tr><td class="number">18</td><td>    <a href="http://www.allegro.cc/manual/allegro_init" target="_blank"><span class="a">allegro_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">19</td><td>  <a href="http://www.allegro.cc/manual/set_color_depth" target="_blank"><span class="a">set_color_depth</span></a><span class="k2">(</span><span class="n">8</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">20</td><td>  <a href="http://www.allegro.cc/manual/set_color_conversion" target="_blank"><span class="a">set_color_conversion</span></a><span class="k2">(</span><span class="n">8</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">21</td><td>  <a href="http://www.allegro.cc/manual/install_keyboard" target="_blank"><span class="a">install_keyboard</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">22</td><td>  <a href="http://www.allegro.cc/manual/install_mouse" target="_blank"><span class="a">install_mouse</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">23</td><td>  <a href="http://www.allegro.cc/manual/install_timer" target="_blank"><span class="a">install_timer</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span> <span class="c">/*don't know if you need this*/</span></td></tr><tr><td class="number">24</td><td>    setup_screen<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">25</td><td>  <a href="http://www.allegro.cc/manual/show_mouse" target="_blank"><span class="a">show_mouse</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">26</td><td><span class="k2">}</span></td></tr><tr><td class="number">27</td><td>&#160;</td></tr><tr><td class="number">28</td><td><span class="k1">int</span> main<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span></td></tr><tr><td class="number">29</td><td><span class="k2">{</span></td></tr><tr><td class="number">30</td><td>  setup<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">31</td><td>  </td></tr><tr><td class="number">32</td><td>    <a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>title<span class="k2">;</span></td></tr><tr><td class="number">33</td><td>    title <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"title.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">34</td><td>  <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span>title<span class="k2">)</span></td></tr><tr><td class="number">35</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">36</td><td>    <a href="http://www.allegro.cc/manual/allegro_message" target="_blank"><span class="a">allegro_message</span></a><span class="k2">(</span><span class="s">"Error loading title.bmp"</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">37</td><td>    <span class="k1">return</span> <span class="n">1</span><span class="k2">;</span></td></tr><tr><td class="number">38</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">39</td><td>  <span class="k1">while</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_ESC<span class="k2">]</span><span class="k2">)</span></td></tr><tr><td class="number">40</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">41</td><td>    <a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,title,<span class="n">250</span>,<span class="n">250</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">42</td><td>    <a href="http://www.allegro.cc/manual/rest" target="_blank"><span class="a">rest</span></a><span class="k2">(</span><span class="n">120</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">43</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">44</td><td>  <a href="http://www.allegro.cc/manual/destroy_bitmap" target="_blank"><span class="a">destroy_bitmap</span></a><span class="k2">(</span>title<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">45</td><td>    <a href="http://www.allegro.cc/manual/allegro_exit" target="_blank"><span class="a">allegro_exit</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">46</td><td>  <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">47</td><td><span class="k2">}</span></td></tr><tr><td class="number">48</td><td><a href="http://www.allegro.cc/manual/END_OF_MAIN" target="_blank"><span class="a">END_OF_MAIN</span></a><span class="k2">(</span><span class="k2">)</span></td></tr></tbody></table></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Charles256)</author>
		<pubDate>Mon, 26 Feb 2007 10:03:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The combination of your code and the title.bmp file you attached earlier works fine for me. The only thing different I&#39;m doing is using MinGW instead of MSVC.</p><p>I&#39;ve attached the .exe to this post. Check to see that it works when it&#39;s in the same directory as the .bmp.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Mon, 26 Feb 2007 16:28:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
<span class="source-code"><a href="http://www.allegro.cc/manual/set_color_conversion" target="_blank"><span class="a">set_color_conversion</span></a><span class="k2">(</span><span class="n">8</span><span class="k2">)</span><span class="k2">;</span></span>
</p></div></div><p>
You&#39;re STILL not doing it right! <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Mon, 26 Feb 2007 18:52:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>i deleted the set color conversion entirely and it still didn&#39;t work. i didn&#39;t follow what you wanted me to do originally when you said i wasn&#39;t doing it right.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Charles256)</author>
		<pubDate>Mon, 26 Feb 2007 18:54:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
i deleted the set color conversion entirely and it still didn&#39;t work. i didn&#39;t follow what you wanted me to do originally when you said i wasn&#39;t doing it right.
</p></div></div><p>

You supply a mode that says how conversions are specified. To see a list of the valid modes, see the <a href="http://www.allegro.cc/manual/api/loading-image-files/set_color_conversion">manual</a>.</p><p>And did the .exe I provided work for you?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Mon, 26 Feb 2007 19:22:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Quoting the manual on <tt>allegro_message</tt>: &quot;Outputs a message, using a printf() format string. Usually you want to use this to report messages to the user in an OS independant way when some Allegro subsystem cannot be initialised. <b>But you must not use this function if you are in a graphic mode, only before calling set_gfx_mode(), or after a set_gfx_mode(GFX_TEXT).</b> Also, this function depends on a system driver being installed, which means that it won&#39;t display the message at all on some platforms if Allegro has not been initialised correctly.&quot; [emphasis added, ed.]</p><p>That said, LennyLen&#39;s exe with your bitmaps (I tried them all by renaming them to <tt>title.bmp</tt> sequentially) displayed a white rectangle in the middle of the window for the two <tt>title.bmp</tt>s, and some weird pixels for <tt>test.bmp</tt> that look like the bitmap was loaded correctly, but drawn with the wrong palette set.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Indeterminatus)</author>
		<pubDate>Mon, 26 Feb 2007 20:01:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>: sighs : it still didn&#39;t work for me.... I have a small theory... Windows Vista no longer sees it&#39;s directory as C:\PROGRA~1\micro~\blah\blah any more. It actually now acknowledges it as literally &quot;C:\Program Files\Microsoft Visual Studio&quot; maybe it&#39;s getting lost? Somehow I doubt that but it was the problem I ran into when I tried to compile allegro. I eventually gave in and just used the pre-compiled files. :-D So, to someone who has this working. Can you please tell me your exact system setup. I&#39;ll miss my parameter pop up on functions but I&#39;ll get over it and c++ is c++ anywhere so I&#39;m to the point I&#39;m willing to try a different compiler. And a continuing thanks to all those that contniue to provide input.</p><p>Edit: Installed XP Pro. Set up everything. At first it didn&#39;t work. Rebooted my computer, worked like a charm with my existing code. You shall see a remake and improvement on New Horizons: Uncharter Waters from me shortly. ( SNES, Sega, PC, and Nintendo version of aforementioned games exist)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Charles256)</author>
		<pubDate>Mon, 26 Feb 2007 20:34:25 +0000</pubDate>
	</item>
</rss>
