<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Anti-aliasing is not working</title>
		<link>http://www.allegro.cc/forums/view/617802</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 12 Apr 2019 07:26:02 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I am trying Anti-aliasing in my code but it&#39;s not working.</p><p>please help me.</p><p>al_set_new_display_option(ALLEGRO_SAMPLE_BUFFERS, 1, ALLEGRO_SUGGEST);<br />al_set_new_display_option(ALLEGRO_SAMPLES, 8, ALLEGRO_SUGGEST);<br />al_set_new_bitmap_flags(ALLEGRO_MIN_LINEAR | ALLEGRO_MAG_LINEAR);</p><p>the code above which I copied from GitHub&#39;s Wiki</p><p>the code which I wrote</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="p">#include &lt;allegro5/allegro.h&gt;</span>
<span class="number">  2</span><span class="p">#include &lt;allegro5/allegro_primitives.h&gt;</span>
<span class="number">  3</span>
<span class="number">  4</span><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span>
<span class="number">  5</span><span class="k2">{</span>
<span class="number">  6</span>    <a href="http://www.allegro.cc/manual/al_init"><span class="a">al_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  7</span>    <a href="http://www.allegro.cc/manual/al_init_primitives_addon"><span class="a">al_init_primitives_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  8</span>
<span class="number">  9</span>    <a href="http://www.allegro.cc/manual/al_set_new_display_option"><span class="a">al_set_new_display_option</span></a><span class="k2">(</span>ALLEGRO_SAMPLE_BUFFERS, <span class="n">1</span>, ALLEGRO_SUGGEST<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>    <a href="http://www.allegro.cc/manual/al_set_new_display_option"><span class="a">al_set_new_display_option</span></a><span class="k2">(</span>ALLEGRO_SAMPLES, <span class="n">8</span>, ALLEGRO_SUGGEST<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 11</span>    <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_MIN_LINEAR <span class="k3">|</span> ALLEGRO_MAG_LINEAR<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 12</span>
<span class="number"> 13</span>    <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a> <span class="k3">*</span>display <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a><span class="k2">(</span><span class="n">800</span>, <span class="n">600</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>
<span class="number"> 15</span>    <a href="http://www.allegro.cc/manual/al_clear_to_color"><span class="a">al_clear_to_color</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">255</span>, <span class="n">255</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 16</span>    <span class="c">//al_draw_circle(400, 300, 100, al_map_rgb_f(1, 0, 1), 2);</span>
<span class="number"> 17</span>    <a href="http://www.allegro.cc/manual/al_draw_rounded_rectangle"><span class="a">al_draw_rounded_rectangle</span></a><span class="k2">(</span><span class="n">400</span><span class="k3">-</span><span class="n">100</span>, <span class="n">300</span><span class="k3">-</span><span class="n">20</span>, <span class="n">400</span><span class="k3">+</span><span class="n">100</span>, <span class="n">300</span><span class="k3">+</span><span class="n">20</span>, <span class="n">20</span>, <span class="n">20</span>, <a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">70</span>, <span class="n">60</span> , <span class="n">100</span><span class="k2">)</span>, <span class="n">2</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 18</span>    <a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 19</span>    <a href="http://www.allegro.cc/manual/al_rest"><span class="a">al_rest</span></a><span class="k2">(</span><span class="n">5</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 20</span>
<span class="number"> 21</span>    <a href="http://www.allegro.cc/manual/al_destroy_display"><span class="a">al_destroy_display</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 22</span>    <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 23</span><span class="k2">}</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Doctor Cop)</author>
		<pubDate>Sun, 07 Apr 2019 15:14:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ALLEGRO_*_LINEAR only works for filtering bitmaps. ALLEGRO_SUGGEST is just that, a suggestion. It doesn&#39;t gurantee that the option you requested is active. You have to check with al_get_display_option to see if it was successful.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 07 Apr 2019 18:47:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Is there a way to get smoother primitives guaranteed?</p><p>I want to make something with primitives, which library can provide me vector graphics like primitives?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Doctor Cop)</author>
		<pubDate>Sun, 07 Apr 2019 19:39:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There is no guarantee. You can use ALLEGRO_REQUIRE and check for a null display. Also, primitives are not vector graphics. Vector graphics can scale to any size.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 07 Apr 2019 20:03:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617802/1041932#target">Edgar Reynaldo</a> said:</div><div class="quote"><p> Also, primitives are not vector graphics.</p></div></div><p>This is not correct.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617802/1041928#target">Doctor Cop</a> said:</div><div class="quote"><p> I am trying Anti-aliasing in my code but it&#39;s not working.</p></div></div><p>What OS? If it&#39;s Windows, maybe try OpenGL.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Tue, 09 Apr 2019 05:53:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Okay so draw an arc at two different sizes and tell me the curvature is the same. Primitives are approximations. Vector graphics can be drawn with primitives but that doesn&#39;t make them the same.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 09 Apr 2019 07:23:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617802/1041931#target">Doctor Cop</a> said:</div><div class="quote"><p>which library can provide me vector graphics like primitives?</p></div></div><p>

Maybe worth mentioning that if you&#39;re including vector graphics <i>storage formats</i> (like SVG) in that question: these can&#39;t be rendered with Allegro 5. There might be a library out there that can load an SVG and resolve its paths to vertices for a given scale, but a quick Google yielded nothing for me.</p><p>However, because of SVG&#39;s abundance, I wonder whether this&#39;d make a good add-on?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Tue, 09 Apr 2019 18:03:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Run time generation of SVG images scaled to destination would be cool. Pre-rendered or drawn on the fly? There&#39;s a big performance hit for decoding it multiple times, and there&#39;s always mip-maps.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 09 Apr 2019 21:18:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="https://wiki.gnome.org/Projects/LibRsvg">librsvg</a> will do it. You&#39;d have to make cairo render to a memory buffer which could be converted to an ALLEGRO_BITMAP. <br />SVG is so complicated that I would imagine doing that in real time would be quite slow.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Hull)</author>
		<pubDate>Tue, 09 Apr 2019 23:58:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hmm, so vector graphics for GUI is a no?</p><p>I wonder, How are browsers like Mozilla and Chrome are drawing so smooth layouts?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Doctor Cop)</author>
		<pubDate>Thu, 11 Apr 2019 18:37:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>GUIs absolutely can (and arguably should) be built from vector graphics such that you can do smooth DPI scaling. The user always has the option to veto antialiasing regardless.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617802/1041979#target">Doctor Cop</a> said:</div><div class="quote"><p>How are browsers like Mozilla and Chrome are drawing so smooth layouts?</p></div></div><p>

Trust me, you don&#39;t want to worry about how web browsers optimise their renders. It isn&#39;t pretty. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617802/1041955#target">Peter Hull</a> said:</div><div class="quote"><p>You&#39;d have to make cairo render to a memory buffer which could be converted to an ALLEGRO_BITMAP.</p></div></div><p>

Huh, this&#39;d be great if we&#39;re happy to do the initial [expensive] rasterisation at init, so we end up with mipmaps like Edgar&#39;s suggesting.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Thu, 11 Apr 2019 19:47:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can do realtime rendering of resolution independent curves in with antialiasing on a non-MSAA framebuffer: <a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2005/01/p1000-loop.pdf">https://www.microsoft.com/en-us/research/wp-content/uploads/2005/01/p1000-loop.pdf</a></p><p>I have an implementation for quadratic curves that&#39;s really optimized: <a href="https://github.com/aaronbolyard/Algae.Canvas">https://github.com/aaronbolyard/Algae.Canvas</a></p><p>It&#39;s just patented until 2026. Thus, unless you license it, you&#39;re SOL unless you find a different way of doing it. <img src="http://www.allegro.cc/forums/smileys/cry.gif" alt=":&#39;(" /></p><p>I decided the difficulties aren&#39;t worth it and have been using vector graphics rasterized offline (ItsyRealm) or vector graphics decomposed into straight lines segments then rasterized to a texture at runtime (Lacklore; necessary for changing fill styles, etc at runtime).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Erin Maus)</author>
		<pubDate>Fri, 12 Apr 2019 07:26:02 +0000</pubDate>
	</item>
</rss>
