<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Scaling look likes junk.</title>
		<link>http://www.allegro.cc/forums/view/618574</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 18 Dec 2021 09:43:15 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So I&#39;m making a 2D game that runs at 1920x1080, and I want to scale the screen down a bit so it works on other 16x9/16:10 resolutions while keeping the &quot;Base&quot; at my native size. </p><p>I have the following code ran that scales the screen down depending on the resolution chosen.</p><p>//This scales the display to any resolution (Native is 1920x1080<br />	float scaleX = al_get_display_width(display) / (float)1920;<br />	float scaleY = al_get_display_height(display) / (float)1080;<br />	ALLEGRO_TRANSFORM trans;<br />	al_identity_transform(&amp;trans);<br />	al_scale_transform(&amp;trans, scaleX, scaleY);<br />	al_use_transform(&amp;trans);</p><p>however, when I run my game at, say. 1280x720 everything looks all jaggy and gross. (Attached us a text example) </p><p>Is there a way to scale down without it looking like butt?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (nshade)</author>
		<pubDate>Fri, 17 Dec 2021 22:56:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can use either ALLEGRO_MIN_LINEAR or not to use linear scaling when scaling down. It&#39;s a new bitmap flag.</p><p>Try both options first.</p><p>It looks fine to my poor eyes.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 17 Dec 2021 23:36:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m not following ---</p><p>Where do I use this flag. I&#39;m not scaling my bitmap, I&#39;m transforming the whole display. </p><p>I&#39;m looking fro something that effects al_scale_transform that has some filtering in it. Will I have to draw to a memory bitmap and then do a al_draw_scaled_bitmap() to a smaller backbuffer?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (nshade)</author>
		<pubDate>Sat, 18 Dec 2021 00:36:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>No, you don&#39;t need any memory bitmaps. It can all be done in video.</p><p>You use <a href="https://liballeg.org/a5docs/trunk/graphics.html#al_set_new_bitmap_flags">al_set_new_bitmap_flags</a> before creating your bitmap with ALLEGRO_MIN_LINEAR to use linear filtering when drawing smaller versions of the bitmap. So you&#39;ll need a buffer at your native resolution which you draw scaled to the screen.</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_set_new_bitmap_flags"><span class="a">al_set_new_bitmap_flags</span></a><span class="k2">(</span>ALLEGRO_VIDEO_BITMAP <span class="k3">|</span> ALLEGRO_MIN_LINEAR<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a><span class="k3">*</span> buffer <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_bitmap"><span class="a">al_create_bitmap</span></a><span class="k2">(</span><span class="n">1920</span>,<span class="n">1080</span><span class="k2">)</span><span class="k2">;</span><span class="c">// make the native resolution buffer</span>
<span class="c">/// Draw at full resolution</span>
<a href="http://www.allegro.cc/manual/ALLEGRO_TRANSFORM"><span class="a">ALLEGRO_TRANSFORM</span></a> t <span class="k3">=</span> al_create_transform<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_identity_transform"><span class="a">al_identity_transform</span></a><span class="k2">(</span><span class="k3">&amp;</span>t<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_scale_transform"><span class="a">al_scale_transform</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_display_width"><span class="a">al_get_display_width</span></a><span class="k2">(</span>display<span class="k2">)</span> <span class="k3">/</span> <span class="n">1920</span>.<span class="n">0f</span> , <a href="http://www.allegro.cc/manual/al_get_display_height"><span class="a">al_get_display_height</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k3">/</span><span class="n">1080</span>.<span class="n">0f</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_use_transform"><span class="a">al_use_transform</span></a><span class="k2">(</span><span class="k3">&amp;</span>t<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_draw_bitmap"><span class="a">al_draw_bitmap</span></a><span class="k2">(</span>buffer , <span class="n">0</span> , <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 18 Dec 2021 00:56:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s what I was looking for! Thank you so much!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (nshade)</author>
		<pubDate>Sat, 18 Dec 2021 09:43:15 +0000</pubDate>
	</item>
</rss>
