<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Out of curiousity, Allegro 4/5 bitmap dimensions</title>
		<link>http://www.allegro.cc/forums/view/615172</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 08 Mar 2015 01:09:22 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I know there will be a really good explanation...</p><p>But why in Allegro 4 with bitmaps I can just get the height/width of a bitmap<br />but -&gt;w, or -&gt;h, etc, but in Allegro 5 I have to call the al_get_bitmap_width/height function?</p><p>It seems a backward step in the pursuit of elegance imho, but as I said I am sure there is a really good explanation why I have to keep typing out so many characters. Which incidentally increases the line length, and is a slight irk when<br />formatting the text for readability. I know I could define it away, but I was wondering why it had ended up like it had.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Yodhe23)</author>
		<pubDate>Sat, 07 Mar 2015 16:05:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s generally accepted that you should use getter and setter functions for field access in an API and never allow directly reading or writing them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sat, 07 Mar 2015 18:45:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ahh those general them.... <b>shakes his fist at them and mutters something about buffer overruns in his day were do with trains not coding</b>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Yodhe23)</author>
		<pubDate>Sat, 07 Mar 2015 21:56:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Making types opaque (only interactable through pointers to them) simplifies the backwards compatibility story. Since 5.0, the internals of <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a></span> changed significantly, and that would not have been possible if all the variables in that struct were directly accessible. I suppose that doesn&#39;t really apply to width/height, since those remained basically the same... but consider <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_bitmap_flags"><span class="a">al_get_bitmap_flags</span></a></span>. By your argument, you&#39;d prefer <span class="source-code">bitmap-&gt;flags</span>, and that was what <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_bitmap_flags"><span class="a">al_get_bitmap_flags</span></a></span> returned... but recently, it got changed to this:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">int</span> <a href="http://www.allegro.cc/manual/al_get_bitmap_flags"><span class="a">al_get_bitmap_flags</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a> <span class="k3">*</span>bitmap<span class="k2">)</span>
<span class="k2">{</span>
   <span class="k1">if</span> <span class="k2">(</span>bitmap-&gt;parent<span class="k2">)</span>
      <span class="k1">return</span> bitmap-&gt;parent-&gt;_flags<span class="k2">;</span>
   <span class="k1">else</span>
      <span class="k1">return</span> bitmap-&gt;_flags<span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

I.e. sub-bitmaps now inherit flags from the parent. Something like this would not have been possible to do in a backwards compatible way if we let you access that member directly.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Sun, 08 Mar 2015 01:09:22 +0000</pubDate>
	</item>
</rss>
