<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Ho to use multi sampling ?</title>
		<link>http://www.allegro.cc/forums/view/610986</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 06 Sep 2012 06:09:12 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello,</p><p>(Sorry for my bad english)</p><p>I&#39;m having trouble with the multi-sampling, I know that this function il enabled by default, but when I try this:</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><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">  2</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">  3</span>    <span class="k1">if</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_display_option"><span class="a">al_get_display_option</span></a><span class="k2">(</span>Affichage, ALLEGRO_SAMPLE_BUFFERS<span class="k2">)</span><span class="k2">)</span>
<span class="number">  4</span>    <span class="k2">{</span>
<span class="number">  5</span>        <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"With multisampling, level %i\n"</span>, <a href="http://www.allegro.cc/manual/al_get_display_option"><span class="a">al_get_display_option</span></a><span class="k2">(</span>Affichage, ALLEGRO_SAMPLES<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  6</span>    <span class="k2">}</span>
<span class="number">  7</span>    <span class="k1">else</span>
<span class="number">  8</span>    <span class="k2">{</span>
<span class="number">  9</span>        <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Without multisampling.\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>    <span class="k2">}</span>
</div></div><p>

It return &quot;Without multisampling&quot; . . .<br />I draw on a bitmap, and then draw that bitmap on the screen like I saw on a tutorial:</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><a href="http://www.allegro.cc/manual/al_set_target_bitmap"><span class="a">al_set_target_bitmap</span></a><span class="k2">(</span>Buffer<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 2</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">0</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 3</span><a href="http://www.allegro.cc/manual/al_draw_line"><span class="a">al_draw_line</span></a><span class="k2">(</span>x1, y1, x2, y2, <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">120</span>, <span class="n">120</span><span class="k2">)</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 4</span>    <a href="http://www.allegro.cc/manual/al_set_target_bitmap"><span class="a">al_set_target_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_backbuffer"><span class="a">al_get_backbuffer</span></a><span class="k2">(</span>Affichage<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 5</span>    <a href="http://www.allegro.cc/manual/al_draw_scaled_bitmap"><span class="a">al_draw_scaled_bitmap</span></a><span class="k2">(</span>Buffer, <span class="n">0</span>, <span class="n">0</span>, LargeurAffichage, HauteurAffichage, <span class="n">0</span>, <span class="n">0</span>, <span class="n">1920</span>, <span class="n">1080</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
</div></div><p>

So I don&#39;t know where is the problem . . .</p><p>Thanks for your help</p><p>PS: My graphic crad is a 520M
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Soporythmique)</author>
		<pubDate>Thu, 06 Sep 2012 05:24:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>1) I think you have to be drawing onto the display for multisampling to work (but I could be wrong!)</p><p>2) According to your code you&#39;re setting those display options (SAMPLE_BUFFERS, SAMPLES) after you already have a display. You have to set the before you create a display.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Thu, 06 Sep 2012 05:27:35 +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/610986/965156#target">Trent Gamblin</a> said:</div><div class="quote"><p>According to your code you&#39;re setting those display options (SAMPLE_BUFFERS, SAMPLES) after you already have a display. You have to set the before you create a display.</p></div></div><p>2</p><p>Thank you it was just that, I thought it was activated by default.</p><p>Just a last question, I didn&#39;t understound the utility of drawing on a bitmap for then draw this bitmap on the screen . . . it use twice more time no ?</p><p>Currently I draw directly on the screen, and it work perfectly.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Soporythmique)</author>
		<pubDate>Thu, 06 Sep 2012 05:51:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Multisampling only works when drawing directly to the display.</p><p>(We could add multisampling for offscreen targets if someone needs it and wants to implement it, for example by using this extension: <a href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_multisampled_render_to_texture.txt">http://www.khronos.org/registry/gles/extensions/EXT/EXT_multisampled_render_to_texture.txt</a></p><p>Either just enabling it for all video bitmaps if the display has multi-sampling or adding a new bitmap flag would work API-wise I think.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Thu, 06 Sep 2012 05:51:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Enable it with a <s>display</s> bitmap flag out of those two options. Otherwise there&#39;s no way to get a non-multisampled bitmap if you have a multi-sampled display. I&#39;m sure there&#39;s a use case.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Thu, 06 Sep 2012 06:09:12 +0000</pubDate>
	</item>
</rss>
