<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>allegro_gl_printf() and text_height()</title>
		<link>http://www.allegro.cc/forums/view/560721</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 21 Jan 2006 05:34:26 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Greetings everyone,</p><p>I&#39;ve been using allegro 4.0.3 and allegrogl 0.2.4 and I&#39;ve been pretty happy with the results.  I&#39;m having some difficulty with rendering text, however, and I&#39;m hoping someone out there can give me some pointers.</p><p>I&#39;ve been using the allegro text API to render all my text and it has worked as expected with neither muss nor fuss.  But I recently ram my game on a number of laptops and noticed a tremendous drop in framerate whenever text is being rendered. </p><p>I assumed that this had to do with a mode change between allegrogl and allegro and so I looked into the font API that allegrogl offers to see if I could speed things up by avoiding mode switches.</p><p>allegro_gl_printf() is indeed speedy, but the rest of the API is pretty sparse.  I need to be able to determine the length of rendered text in order to apply word wrapping and I can&#39;t see any text_height() or text_length() equivalents. </p><p>Any suggestions?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (colin fletcher)</author>
		<pubDate>Sat, 21 Jan 2006 02:16:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can simply use text_length() on AllegroGL fonts, that&#39;s the reason why they also are represented by FONT * pointers <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sat, 21 Jan 2006 02:37:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Fancy! Thanks.</p><p>EDIT:</p><p>Actually, this code produces an access violation.  Is there something else I have to do here?</p><div class="source-code snippet"><div class="inner"><pre><span class="c">// install allegro..</span>
<span class="c">// install allegrogl..</span>
<span class="c">// set graphics mode..</span>

<span class="k1">char</span><span class="k3">*</span> s <span class="k3">=</span> <span class="s">"hello my name is simon"</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/FONT" target="_blank"><span class="a">FONT</span></a><span class="k3">*</span> f <span class="k3">=</span> allegro_gl_convert_allegro_font_ex<span class="k2">(</span>
            <a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>,
            AGL_FONT_TYPE_TEXTURED, 
            <span class="n">1</span>.<span class="n">0</span>, 
            GL_ALPHA8<span class="k2">)</span><span class="k2">;</span>

<span class="k1">int</span> length <span class="k3">=</span> <a href="http://www.allegro.cc/manual/text_length" target="_blank"><span class="a">text_length</span></a><span class="k2">(</span>f,s<span class="k2">)</span><span class="k2">;</span>  <span class="c">// crashes here</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (colin fletcher)</author>
		<pubDate>Sat, 21 Jan 2006 02:58:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The text_*() bugs have been fixed in the CVS version of AllegroGL.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bob)</author>
		<pubDate>Sat, 21 Jan 2006 04:33:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Actually, there&#39;s an unapplied patch on the AGL mailing list which fixes a small bug in text_length() <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sat, 21 Jan 2006 04:38:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks, guys.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (colin fletcher)</author>
		<pubDate>Sat, 21 Jan 2006 05:34:26 +0000</pubDate>
	</item>
</rss>
