<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Bmp flicker, noob question</title>
		<link>http://www.allegro.cc/forums/view/573845</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 20 Mar 2006 09:36:32 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>For some reason I&#39;ve got this flicker on my mouse pointer, I&#39;m not for sure why everything else draw to the screen seems to be perfectly fine. The following code is all located in the main loop, with the latter in the while.  Maybe you can tell me what I&#39;ve done wrong, thanks.</p><div class="source-code snippet"><div class="inner"><pre><span class="c">// Load the custom mouse pointer</span>
<a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>reticle <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"reticle.bmp"</span>, NULL<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/set_mouse_sprite" target="_blank"><span class="a">set_mouse_sprite</span></a><span class="k2">(</span>reticle<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/set_mouse_sprite_focus" target="_blank"><span class="a">set_mouse_sprite_focus</span></a><span class="k2">(</span>reticle-&gt;w<span class="k3">/</span><span class="n">2</span>,reticle-&gt;h<span class="k3">/</span><span class="n">2</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/show_mouse" target="_blank"><span class="a">show_mouse</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

</p><div class="source-code snippet"><div class="inner"><pre><span class="c">// Blit the double buffer </span>
<a href="http://www.allegro.cc/manual/vsync" target="_blank"><span class="a">vsync</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/acquire_screen" target="_blank"><span class="a">acquire_screen</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/blit" target="_blank"><span class="a">blit</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, WIDTH-1, HEIGHT-1<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/release_screen" target="_blank"><span class="a">release_screen</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Nelson Cole)</author>
		<pubDate>Mon, 20 Mar 2006 04:29:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;re drawing the mouse to the screen, not the buffer. Draw it to the buffer and then draw the buffer on the screen like you&#39;re already doing.</p><p><span class="source-code"><a href="http://www.allegro.cc/manual/show_mouse" target="_blank"><span class="a">show_mouse</span></a><span class="k2">(</span>buffer<span class="k2">)</span><span class="k2">;</span></span><br />or
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/show_mouse" target="_blank"><span class="a">show_mouse</span></a><span class="k2">(</span>NULL<span class="k2">)</span><span class="k2">;</span> <span class="c">//not sure if you're allowed to use this line...</span>

<span class="k1">while</span><span class="k2">(</span>game_loop<span class="k2">)</span> <span class="k2">{</span>
  draw_spirte<span class="k2">(</span>buffer,<a href="http://www.allegro.cc/manual/mouse_sprite" target="_blank"><span class="a">mouse_sprite</span></a>,<a href="http://www.allegro.cc/manual/mouse_x" target="_blank"><span class="a">mouse_x</span></a>,<a href="http://www.allegro.cc/manual/mouse_y" target="_blank"><span class="a">mouse_y</span></a><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ceagon Xylas)</author>
		<pubDate>Mon, 20 Mar 2006 04:33:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>you can still show the mouse to the screen, but you have to hide it first before blitting the buffer.</p><p>ie </p><p>hidemouse<br />blit buffer to screen<br />showmouse
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CosmicR)</author>
		<pubDate>Mon, 20 Mar 2006 05:14:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yo guys thanks, i got it working.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Nelson Cole)</author>
		<pubDate>Mon, 20 Mar 2006 06:31:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Don&#39;t use show_mouse on the buffer. It&#39;s not safe, and just wastes the CPU by redrawing a lot when it&#39;ll never show. Use the show_mouse(NULL) and draw_sprite method.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Mon, 20 Mar 2006 09:36:32 +0000</pubDate>
	</item>
</rss>
