<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>help with alegro api</title>
		<link>http://www.allegro.cc/forums/view/556241</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 31 Dec 2005 05:42:17 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>

 Posted on 12-29-2005 4:43 PM      <br />hey, umm </p><p>int do_menu(MENU *menu, int x, int y);</p><p>i can&#39;t get it to work..i tried</p><p>MENU* aMenu;</p><p>//then</p><p>do_menu(aMenu, 200, 200);</p><p>//but the program crashed..so then i looked into MENU</p><p>//its a struct, </p><p>//typedef struct MENU</p><p>// char *text; - the text to display for the menu item<br />int (*proc)(void); - called when the menu item is clicked<br />struct MENU *child; - nested child menu<br />int flags; - disabled or checked state<br />void *dp; - pointer to any data you need</p><p>//sodo i need to define aMenu or what? i need help
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Money)</author>
		<pubDate>Fri, 30 Dec 2005 04:07:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yep.</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">int</span> myfunc<span class="k2">(</span><span class="k2">)</span>
<span class="k2">{</span>
    <span class="c">// whatever</span>
<span class="k2">}</span>

<a href="http://www.allegro.cc/manual/MENU" target="_blank"><span class="a">MENU</span></a> mymenu<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span> <span class="k2">{</span>
  <span class="k2">{</span> <span class="s">"Menu item name"</span>, myfunc, NULL <span class="c">/* can be a child menu item */</span>, <span class="n">0</span>, NULL <span class="k2">}</span>,
  <span class="k2">{</span> NULL, NULL, NULL, <span class="n">0</span>, NULL<span class="k2">}</span>
<span class="k2">}</span><span class="k2">;</span>

<a href="http://www.allegro.cc/manual/do_menu" target="_blank"><span class="a">do_menu</span></a><span class="k2">(</span>mymenu, <span class="n">200</span>, <span class="n">200</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Fri, 30 Dec 2005 04:09:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ohhh, ok , thanks ...that made me understand the allegro api like a lot better
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Money)</author>
		<pubDate>Fri, 30 Dec 2005 04:10:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The crash was because the pointer was null (eg. not set). You need an array of MENU objects instead of an empty pointer (as in BAF&#39;s code)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fladimir da Gorf)</author>
		<pubDate>Fri, 30 Dec 2005 04:12:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;re welcome. Welcome to Allegro.cc, by the way... I forgot to say that in my post in your other thread.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Fri, 30 Dec 2005 04:12:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>btw, im using c++ not c</p><p>can u give it to me in c form?</p><p>because this is what i had</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">int</span> main<span class="k2">(</span><span class="k1">void</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>    <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">6</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">7</td><td>&#160;</td></tr><tr><td class="number">8</td><td>    <a href="http://www.allegro.cc/manual/MENU" target="_blank"><span class="a">MENU</span></a> mymenu<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="s">"Menu item name"</span>, myfunc, NULL <span class="c">/* can be a child menu item */</span>, <span class="n">0</span>, NULL <span class="k2">}</span>, NULL, NULL, NULL, <span class="n">0</span>, NULL<span class="k2">}</span></td></tr><tr><td class="number">11</td><td><span class="k2">}</span><span class="k2">;</span></td></tr><tr><td class="number">12</td><td>&#160;</td></tr><tr><td class="number">13</td><td>&#160;</td></tr><tr><td class="number">14</td><td>&#160;</td></tr><tr><td class="number">15</td><td>    <a href="http://www.allegro.cc/manual/acquire_screen" target="_blank"><span class="a">acquire_screen</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td>    <a href="http://www.allegro.cc/manual/do_menu" target="_blank"><span class="a">do_menu</span></a><span class="k2">(</span>mymenu, <span class="n">200</span>, <span class="n">200</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">18</td><td>&#160;</td></tr><tr><td class="number">19</td><td>    <a href="http://www.allegro.cc/manual/release_screen" target="_blank"><span class="a">release_screen</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">20</td><td>&#160;</td></tr><tr><td class="number">21</td><td>    <a href="http://www.allegro.cc/manual/readkey" target="_blank"><span class="a">readkey</span></a><span class="k2">;</span></td></tr><tr><td class="number">22</td><td>&#160;</td></tr><tr><td class="number">23</td><td>    <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">24</td><td><span class="k2">}</span></td></tr><tr><td class="number">25</td><td>&#160;</td></tr><tr><td class="number">26</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><span class="k2">;</span></td></tr></tbody></table></div></div><p>



/errors</p><p>Project   : Win32 Application<br />Compiler  : GNU GCC Compiler (called directly)<br />Directory : C:\Documents and Settings\Lavontae\Desktop\<br />--------------------------------------------------------------------------------<br />Switching to target: default<br />Compiling: main.cpp<br />main.cpp: In function `int _mangled_main()&#39;:<br />main.cpp:8: error: expected primary-expression before &quot;mymenu&quot;<br />main.cpp:8: error: expected `;&#39; before &quot;mymenu&quot;<br />main.cpp:10: error: expected primary-expression before &#39;,&#39; token<br />main.cpp:10: error: expected `;&#39; before &#39;}&#39; token<br />main.cpp: At global scope:<br />main.cpp:11: error: expected declaration before &#39;}&#39; token<br />Process terminated with status 1 (0 minutes, 2 seconds)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Money)</author>
		<pubDate>Fri, 30 Dec 2005 04:16:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>you missed the = sign off the array definition.</p><p>also, when you use some of the GUI stuff, you have to make explicit casts when using C++.</p><p>btw, if you are looking at gui stuff, you could always look in the library section at &#39;masking&#39;, it&#39;s a c++ based GUI that produces something a lot prettier.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 30 Dec 2005 04:25:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ummm..</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">int</span> main<span class="k2">(</span><span class="k1">void</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>    <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">6</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">7</td><td>    <a href="http://www.allegro.cc/manual/MENU" target="_blank"><span class="a">MENU</span></a> mymenu<span class="k2">[</span><span class="k2">]</span><span class="k2">;</span></td></tr><tr><td class="number">8</td><td>&#160;</td></tr><tr><td class="number">9</td><td>&#160;</td></tr><tr><td class="number">10</td><td>&#160;</td></tr><tr><td class="number">11</td><td>&#160;</td></tr><tr><td class="number">12</td><td>    <a href="http://www.allegro.cc/manual/acquire_screen" target="_blank"><span class="a">acquire_screen</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td>&#160;</td></tr><tr><td class="number">14</td><td>    <a href="http://www.allegro.cc/manual/do_menu" target="_blank"><span class="a">do_menu</span></a><span class="k2">(</span>mymenu, <span class="n">200</span>, <span class="n">200</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">15</td><td>&#160;</td></tr><tr><td class="number">16</td><td>    <a href="http://www.allegro.cc/manual/release_screen" target="_blank"><span class="a">release_screen</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">17</td><td>&#160;</td></tr><tr><td class="number">18</td><td>    <a href="http://www.allegro.cc/manual/readkey" target="_blank"><span class="a">readkey</span></a><span class="k2">;</span></td></tr><tr><td class="number">19</td><td>&#160;</td></tr><tr><td class="number">20</td><td>    <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">21</td><td><span class="k2">}</span></td></tr><tr><td class="number">22</td><td>&#160;</td></tr><tr><td class="number">23</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><span class="k2">;</span></td></tr><tr><td class="number">24</td><td>&#160;</td></tr><tr><td class="number">25</td><td><a href="http://www.allegro.cc/manual/MENU" target="_blank"><span class="a">MENU</span></a> mymenu<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span> <span class="k2">{</span></td></tr><tr><td class="number">26</td><td>  <span class="k2">{</span> <span class="s">"Menu item name"</span>, main, NULL <span class="c">/* can be a child menu item */</span>, <span class="n">0</span>, NULL <span class="k2">}</span>,</td></tr><tr><td class="number">27</td><td>  <span class="k2">{</span> NULL, NULL, NULL, <span class="n">0</span>, NULL<span class="k2">}</span></td></tr><tr><td class="number">28</td><td><span class="k2">}</span><span class="k2">;</span></td></tr></tbody></table></div></div><p>

/errors<br />Project   : Win32 Application<br />Compiler  : GNU GCC Compiler (called directly)<br />Directory : C:\Documents and Settings\Lavontae\Desktop\<br />--------------------------------------------------------------------------------<br />Switching to target: default<br />Compiling: main.cpp<br />main.cpp: In function `int _mangled_main()&#39;:<br />main.cpp:7: error: storage size of `mymenu&#39; isn&#39;t known<br />main.cpp:18: warning: statement is a reference, not call, to function `readkey&#39;<br />Process terminated with status 1 (0 minutes, 1 seconds)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Money)</author>
		<pubDate>Fri, 30 Dec 2005 04:36:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Why are you trying to call main from your menu? And you cant define your menu as nothing in main then expect it to work. And readkey should be readkey().
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Fri, 30 Dec 2005 04:43:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>what do u mean define my menu as nothing?</p><p>is this right?</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">int</span> main<span class="k2">(</span><span class="k1">void</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>    <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">6</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">7</td><td>&#160;</td></tr><tr><td class="number">8</td><td>&#160;</td></tr><tr><td class="number">9</td><td>&#160;</td></tr><tr><td class="number">10</td><td>&#160;</td></tr><tr><td class="number">11</td><td>    <a href="http://www.allegro.cc/manual/acquire_screen" target="_blank"><span class="a">acquire_screen</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">12</td><td>&#160;</td></tr><tr><td class="number">13</td><td>    <a href="http://www.allegro.cc/manual/do_menu" target="_blank"><span class="a">do_menu</span></a><span class="k2">(</span>mymenu, <span class="n">200</span>, <span class="n">200</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">14</td><td>&#160;</td></tr><tr><td class="number">15</td><td>    <a href="http://www.allegro.cc/manual/release_screen" target="_blank"><span class="a">release_screen</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td>    <a href="http://www.allegro.cc/manual/readkey" target="_blank"><span class="a">readkey</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">18</td><td>&#160;</td></tr><tr><td class="number">19</td><td>    <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">20</td><td><span class="k2">}</span></td></tr><tr><td class="number">21</td><td>&#160;</td></tr><tr><td class="number">22</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><span class="k2">;</span></td></tr><tr><td class="number">23</td><td>&#160;</td></tr><tr><td class="number">24</td><td><a href="http://www.allegro.cc/manual/MENU" target="_blank"><span class="a">MENU</span></a> mymenu<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span> <span class="k2">{</span></td></tr><tr><td class="number">25</td><td>  <span class="k2">{</span> <span class="s">"Menu item name"</span>, myFunc, NULL <span class="c">/* can be a child menu item */</span>, <span class="n">0</span>, NULL <span class="k2">}</span>,</td></tr><tr><td class="number">26</td><td>  <span class="k2">{</span> NULL, NULL, NULL, <span class="n">0</span>, NULL<span class="k2">}</span></td></tr><tr><td class="number">27</td><td><span class="k2">}</span><span class="k2">;</span></td></tr><tr><td class="number">28</td><td>&#160;</td></tr><tr><td class="number">29</td><td><span class="k1">void</span> myFunc<span class="k2">(</span><span class="k2">)</span></td></tr><tr><td class="number">30</td><td><span class="k2">{</span></td></tr><tr><td class="number">31</td><td><span class="k2">}</span></td></tr></tbody></table></div></div><p>

make yourself clearer please
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Money)</author>
		<pubDate>Fri, 30 Dec 2005 04:49:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="http://www.allegro.cc/resource/resource-view.php?id=63">http://www.allegro.cc/resource/resource-view.php?id=63</a></p><p>Is Miran&#39;s MasKinG (put random letters capitalised) and will probably suite you better as it is c++, easy to use, and has lots of simple examples.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 30 Dec 2005 04:54:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you haven&#39;t seen it yet, Allegro comes with a couple of example programmes that you can learn from (in allegro/examples/). For instance exgui.c (attached; I didn&#39;t know posts had a size limit...)</p><p>It&#39;s not the shortest possible programme that shows you how to do menus or use the GUI (which, by the way, is not great for use inside an actual game because it&#39;s quite ugly unless you use your own dialog routines), but it is intended to show you how things work and explain things.</p><p>One more suggestion, if I may:
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
u
</p></div></div><p>
Please take the extra two keystrokes and write it out as `you&#39;. For me, `u&#39; is a sound that doesn&#39;t even exist in English and seeing it where `you&#39; is intended interrupts the flow of the text. In other words, it makes it harder for me to read and I find it annoying.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Fri, 30 Dec 2005 05:01:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>thanks neil, thats great...i don&#39;t possibly see how these people code games in C, i have to have classes</p><p>C to me is unorganized like h**l
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Money)</author>
		<pubDate>Fri, 30 Dec 2005 05:12:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Try this site: <a href="http://www.cprogramming.com/tutorial.html">http://www.cprogramming.com/tutorial.html</a></p><p>It&#39;s where I learned most of the basics. I remember how nonsensical it all seemed, and I thought I&#39;d never get past the boring stuff.. but because I couldn&#39;t give up the chance to make cool games, I kept at it. I suggest you do the same.</p><p>By the way, if you&#39;re wondering whether to do the C tutorials or C++ tutorials, it might not matter. I started on C++ and I still understand+write plain C code. Starting in plain C might introduce another learning curve if you start C++ later on, though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (IonBlade)</author>
		<pubDate>Fri, 30 Dec 2005 06:22:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>umm, sorry to burst your bubble ION, but i know c++, when i said classes i mean OO classes,
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Money)</author>
		<pubDate>Fri, 30 Dec 2005 06:36:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
when i said classes i mean OO classes
</p></div></div><p>
Oh, whoops <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
sorry to burst your bubble ION, but i know c++
</p></div></div><p>

You may know C++, but do you how to use it to create games from scratch? IE, create a main loop and set different functions for input, drawing, and logic?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (IonBlade)</author>
		<pubDate>Fri, 30 Dec 2005 06:42:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Is Miran&#39;s MasKinG (put random letters capitalised) and will probably suite you better as it is c++, easy to use, and has lots of simple examples.
</p></div></div><p>

Its MASkinG. Easy to remember. M and A are his initials, Skin for skinnable, and G for GUI. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Fri, 30 Dec 2005 06:47:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
umm, sorry to burst your bubble ION, but i know c++
</p></div></div><p>
Don&#39;t be so quick to attack people, remember they are trying to help you (for free at that!). A few points that I don&#39;t think have been mentioned to you:
</p><ul><li><p>When you have a question do the following:</p></li><li><p>Make sure it is a question.</p></li><li><p>If it is about allegro, check the docs</p></li><li><p>If it&#39;s not in the docs, check the examples</p></li><li><p>If it&#39;s not there (almost everything is there FYI)</p></li></ul><p>
<li>When Posting:</li><br />[list ordered]<br /><li>Use a good title in the proper section</li><br /><li>Be specific, include source if applicable</li><br /><li>Don&#39;t include too much, no one wants to read a bunch of crap to get to the problem</li><br />&lt;/ol&gt;<br />[/list]<br />Anyways, back on topic, don&#39;t give up with the allegro GUI so quickly, while it isn&#39;t the greatest thing ever it&#39;s good to know how it works because if you can figure this out then you can figure out the rest of allegro on your own. <br />About your code, make sure mymenu is defined <b>before</b> you use it. This is something you should know from all C/C++ programming you have done. Remember allegro is just a library, IE a bunch of functions, nothing more. While some of them work together they still function under the rules of C/C++.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (razor)</author>
		<pubDate>Fri, 30 Dec 2005 11:03:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>alright, im sorry. here is my source, i redid it. everytime i run it , it crashes.<br />what am i doing wrong?</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>&#160;</td></tr><tr><td class="number">4</td><td><a href="http://www.allegro.cc/manual/MENU" target="_blank"><span class="a">MENU</span></a> mymenu<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span> <span class="k2">{</span></td></tr><tr><td class="number">5</td><td>  <span class="k2">{</span> <span class="s">"Menu item name"</span>, NULL, NULL <span class="c">/* can be a child menu item */</span>, <span class="n">0</span>, NULL <span class="k2">}</span>,</td></tr><tr><td class="number">6</td><td>  <span class="k2">{</span> NULL, NULL, NULL, <span class="n">0</span>, NULL<span class="k2">}</span></td></tr><tr><td class="number">7</td><td><span class="k2">}</span><span class="k2">;</span></td></tr><tr><td class="number">8</td><td>&#160;</td></tr><tr><td class="number">9</td><td>&#160;</td></tr><tr><td class="number">10</td><td>&#160;</td></tr><tr><td class="number">11</td><td>&#160;</td></tr><tr><td class="number">12</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">13</td><td><span class="k2">{</span></td></tr><tr><td class="number">14</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">15</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">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td>&#160;</td></tr><tr><td class="number">18</td><td>&#160;</td></tr><tr><td class="number">19</td><td>&#160;</td></tr><tr><td class="number">20</td><td>    <a href="http://www.allegro.cc/manual/acquire_screen" target="_blank"><span class="a">acquire_screen</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">21</td><td>&#160;</td></tr><tr><td class="number">22</td><td>    <a href="http://www.allegro.cc/manual/do_menu" target="_blank"><span class="a">do_menu</span></a><span class="k2">(</span>mymenu, <span class="n">200</span>, <span class="n">200</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">23</td><td>&#160;</td></tr><tr><td class="number">24</td><td>    <a href="http://www.allegro.cc/manual/release_screen" target="_blank"><span class="a">release_screen</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">25</td><td>&#160;</td></tr><tr><td class="number">26</td><td>    <a href="http://www.allegro.cc/manual/readkey" target="_blank"><span class="a">readkey</span></a><span class="k2">(</span><span class="k2">)</span><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">return</span> <span class="n">0</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>&#160;</td></tr><tr><td class="number">31</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><span class="k2">;</span></td></tr></tbody></table></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Money)</author>
		<pubDate>Fri, 30 Dec 2005 11:27:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Don&#39;t you need to: <span class="source-code"><a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a></span><img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Onewing)</author>
		<pubDate>Fri, 30 Dec 2005 11:38:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ok, i got it to work.</p><p>it was just some technical difficulties with the compiler , thanks <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Money)</author>
		<pubDate>Fri, 30 Dec 2005 11:44:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
The color depth of the graphic mode has to be specified before calling this function with set_color_depth().
</p></div></div><p>

Also, you can use allegro_message() or, for a more acurate method, a debugger to find out where the program is crashing and then you can say more than &quot;it crashes&quot;.  </p><p>When I&#39;m at work, I sometimes get a call from somebody saying &quot;their computer doesn&#39;t work.&quot;  That&#39;s a very vague statement and usually, it&#39;s something stupid.  My first question is always, &quot;is your monitor turned on?&quot; (yes, sometimes <i>that</i> is the problem).  So, with more details, it&#39;s easier to solve your problem.  <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Onewing)</author>
		<pubDate>Fri, 30 Dec 2005 12:03:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Also, you can use allegro_message() [...] to find out where the program is crashing and then you can say more than &quot;it crashes&quot;.
</p></div></div><p>
Note that you should <i>not</i> use allegro_message() after you&#39;ve called set_gfx_mode(), unless you call set_gfx_mode(GFX_TEXT,...) again first.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Fri, 30 Dec 2005 15:57:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">SS said:</div><div class="quote"><p>
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
The color depth of the graphic mode has to be specified before calling this function with set_color_depth().
</p></div></div><p>
</p></div></div><p>

You don&#39;t have to set the color depth (defaults to 8), but if you are going to set it, you must set it before setting the gfx mode.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
ok, i got it to work.</p><p>it was just some technical difficulties with the compiler , thanks <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div></div><p>

Nah, the only problem was not calling set_gfx_mode. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Sat, 31 Dec 2005 05:42:17 +0000</pubDate>
	</item>
</rss>
