<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Allegro.pas: a wrapper to use Allegro and Pascal</title>
		<link>http://www.allegro.cc/forums/view/588902</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 18 Dec 2006 05:16:47 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m not sure if this is the best place to the thread, so move it if it shouldn&#39;t be there.</p><p>After TINS&#39;06 I discovered that the evolution of my Mingro library was wrong, so I decided to restart it from 0. When I was thinking the new API I discovered that it should be easier if the wrapper to use Allegro in Pascal was as an independent package. After that I find a new job, I move myself to other city and I couldn&#39;t code nothing for a long time <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" />. But few weeks ago I back, and started to code it.</p><p>Yesterday I finished the &quot;Hello, world!&quot; example, so I decided to show it to you because I know there are some allegroids that can code in Pascal and they would be interested in this project... and they would help me to finish it (specially in that parts of Allegro that I&#39;m not familiarized as packed files, audio streams, joystic... and documentation <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /> ).</p><p>So try it and tell me what do you think. Note that the API is slightly different because I need to do some magic to make it work in Delphi (it can&#39;t access to the public variables <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> ) and because some Allegro functions are equal than some Pascal procedures, as the readkey function. You&#39;ll need a C compiler to build a DLL (the <i>magic</i>) and a Pascal compiler for everything else. Current version worked in Wind32 only (a voluntary to port it to other platforms and/or write a better build script?).</p><p>Constructive criticism and help will be welcomed <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>[edit] Wrappers for grabber data files and bitmap blitting and the exdata example written. I&#39;ve changed the attached file.</p><p>Nobody wants see it?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Niunio)</author>
		<pubDate>Tue, 05 Dec 2006 03:28:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t think Id use such a libary but I knew pascal once upon a time so I looked at it. You are just wrapping Allegro right? Why do you have alvtable.pas? And what need is there to define the entire albitmap.pas? Cant you just do<br />BITMAP = POINTER;<br />or something? Then you can provide functions to get width and height instead of just accessing the BITMAP directly. This is what I do in my scheme wrapper for Allegro.</p><p>Also I noticed in alsystem.c you wrapped install_allegro() because its a macro, but did you notice the macro actually just calls the _install_allegro function?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kazzmir)</author>
		<pubDate>Tue, 05 Dec 2006 05:25:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>People still use Pascal? <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Tue, 05 Dec 2006 05:29:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
People still use Pascal? <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" />
</p></div></div><p>
I think that Pascal has interesting syntax...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Archon)</author>
		<pubDate>Tue, 05 Dec 2006 11:29:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">gnolam said:</div><div class="quote"><p>
People still use Pascal?
</p></div></div><p>Didn&#39;t you hear about Delphi or the new <a href="http://www.turboexplorer.com/">Turbos</a>?</p><p>I can code in C, but I find Pascal is less cryptic [edit] and IMHO Object Pascal manages classes and objects better than C++, but it&#39;s only my opinion[/edit]. In TINS&#39;06 I coded <a href="http://amarillion.bafsoft.net/tins06/review.php?gameid=38&amp;show=1">my entry</a> in Object Pascal and I spent less time fixing stupid bugs. That&#39;s why I&#39;m working on this wrapper.
</p><div class="quote_container"><div class="title">kazzmir said:</div><div class="quote"><p>
Why do you have alvtable.pas? And what need is there to define the entire albitmap.pas? Cant you just do BITMAP = POINTER; or something?
</p></div></div><p>Yes, I can if I write more <i>C-magic functions</i> for drawing. But this way the Pascal compiler would try to optimize in the same way that the C compiler does. Also, some Pascal compilers (as Delphi, if I remember correctly) can use inline procedures. If I define &quot;AL_BITMAP = POINTER&quot; then the compiler can&#39;t use inline procedures.</p><p>[edit]</p><div class="quote_container"><div class="title">kazzmir said:</div><div class="quote"><p>
Also I noticed in alsystem.c you wrapped install_allegro() because its a macro, but did you notice the macro actually just calls the _install_allegro function?
</p></div></div><p>Yes I did:</p><div class="source-code snippet"><div class="inner"><pre>AL_INLINE<span class="k2">(</span><span class="k1">int</span>, <a href="http://www.allegro.cc/manual/install_allegro" target="_blank"><span class="a">install_allegro</span></a>, <span class="k2">(</span><span class="k1">int</span> system_id, <span class="k1">int</span> <span class="k3">*</span>errno_ptr,
   AL_METHOD<span class="k2">(</span><span class="k1">int</span>, atexit_ptr, <span class="k2">(</span>AL_METHOD<span class="k2">(</span><span class="k1">void</span>, func, <span class="k2">(</span><span class="k1">void</span><span class="k2">)</span><span class="k2">)</span><span class="k2">)</span><span class="k2">)</span><span class="k2">)</span>,
<span class="k2">{</span>
   <span class="k1">return</span> _install_allegro_version_check<span class="k2">(</span>system_id, errno_ptr, atexit_ptr, \
      <a href="http://www.allegro.cc/manual/MAKE_VERSION" target="_blank"><span class="a">MAKE_VERSION</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/ALLEGRO_VERSION" target="_blank"><span class="a">ALLEGRO_VERSION</span></a>, <a href="http://www.allegro.cc/manual/ALLEGRO_SUB_VERSION" target="_blank"><span class="a">ALLEGRO_SUB_VERSION</span></a>, <a href="http://www.allegro.cc/manual/ALLEGRO_WIP_VERSION" target="_blank"><span class="a">ALLEGRO_WIP_VERSION</span></a><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span><span class="k2">)</span>
</pre></div></div><p>
I started the wrapper before the latest release (4.2.0) with a different install_allegro implementation, more complex, so I decided to &quot;expand&quot; it instead of recode it. Now I don&#39;t need to change it. I&#39;m smart <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" /> or just a lucky boy <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />. Anyway it will be called only once each project.</p><p>[EDIT]</p><p>I&#39;ve released Allegro.pas <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" />. See it <a href="http://allegro-pas.sourceforge.net">here</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Niunio)</author>
		<pubDate>Mon, 18 Dec 2006 05:16:47 +0000</pubDate>
	</item>
</rss>
