<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>I have a problem with animation</title>
		<link>http://www.allegro.cc/forums/view/617913</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 03 Sep 2019 22:04:14 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I created two small programs in which a circle is moved;<br />One has a circle created with primitives and another with a bitmap.<br />Their animation is very bad, it&#39;s not fluid. How can I improve these animations?<br />the two programs are attached.<br />Thank you
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Loki66)</author>
		<pubDate>Sat, 31 Aug 2019 09:45:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This is probably a silly question but are you drawing direct to screen or are you drawing to a buffer page first? A few of my first attempts at moving graphics I drew lines and squares directly to screen. Then I would have to blank out and draw next position. Wasn’t bad but led to some flicker. It didn’t look smooth.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AceBlkwell)</author>
		<pubDate>Sat, 31 Aug 2019 21:40:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I can&#39;t open .rar from my phone, but a couple things you might want to check:</p><ul><li><p>Ensure your animation is updated only once per frame, using a timer.
</p></li><li><p>Try enabling vsync.
</p></li><li><p>If you&#39;re using Allegro 4, as AceBlkwell said, use double buffering. (or do the sensible thing and learn Allegro 5. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /> )
</p></li></ul></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Sat, 31 Aug 2019 23:55:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I looked at the guide of allegro.cc and github, but they are not detailed, there are no examples.<br />thanks anyway
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Loki66)</author>
		<pubDate>Sun, 01 Sep 2019 10:21:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve tried your source code (using a larger bitmap file I already had on my disk) and the animation appears good. I&#39;ve tested on Windows10. Possibly you can provide more details regarding your system?<br />Also, possibly worth mentioning, my monitor is set to refresh at 75 Hz (you seem to be setting your timer to 60Hz which will not be the case on some systems).</p><p>EDIT: I am not sure to understand if you are looking for Allegro5 examples? I think you know about these but just in case, examples are included with the GitHub repo: <a href="https://github.com/liballeg/allegro5/tree/master/examples">https://github.com/liballeg/allegro5/tree/master/examples</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (MikiZX)</author>
		<pubDate>Sun, 01 Sep 2019 16:50:06 +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/617913/1043224#target">MikiZX</a> said:</div><div class="quote"><p>EDIT: I am not sure to understand if you are looking for Allegro5 examples? I think you know about these but just in case, examples are included with the GitHub repo: <a href="https://github.com/liballeg/allegro5/tree/master/examples">https://github.com/liballeg/allegro5/tree/master/examples</a> </p></div></div><p>

What do you think, which example would be best fitting as a starter template for new projects?</p><p>As it&#39;s very hard for most people to write the same code over and over.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Doctor Cop)</author>
		<pubDate>Sun, 01 Sep 2019 19:35:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The wiki has a getting started guide you can find here :</p><p><a href="https://wiki.allegro.cc/index.php?title=Getting_Started#Using_Allegro">https://wiki.allegro.cc/index.php?title=Getting_Started#Using_Allegro</a></p><p><a href="https://github.com/liballeg/allegro_wiki/wiki">https://github.com/liballeg/allegro_wiki/wiki</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 01 Sep 2019 22:48:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The wiki&#39;s <a href="https://github.com/liballeg/allegro_wiki/wiki/Quickstart">quickstart</a> has barebones code.</p><p>Edit: 🐌
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Sun, 01 Sep 2019 22:49:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>🐇</p><p>One thing you want to note is that you&#39;re moving very quickly in terms of pixels. 12 or 20 pixels per update? That&#39;s 720 or 1200 pixels per second, which is very fast, and unless you draw some kind of trail it will appear to &#39;teleport&#39;.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 01 Sep 2019 23:51:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi everyone<br />the operating system I use is windows 10 home edition;<br />the monitor has a frequency of 60 hz, the code I use to check the frequency is:<br />/******************************************************************************<br />   display = al_create_display(SCREEN_W, SCREEN_H);<br />   if(!display) {<br />      fprintf(stderr, &quot;failed to create display!\n&quot;);<br />      return -1;<br />   }</p><p>    float fl_FPS = al_get_display_refresh_rate(display); // verifica la frequenza di aggiornamento del monitor<br />        if (fl_FPS == 0) {<br />		fl_FPS = 60; // se f_FPS e = 0 allora la frequenza è 60 Hz<br />        }</p><p>    timer = al_create_timer(1.0 / fl_FPS);<br />    if(!timer) {<br />        fprintf(stderr, &quot;failed to create timer!\n&quot;);<br />    }<br />/*********************************************************************</p><p>the excessive speed of animation is an example, but it is not fluid even at low speeds.<br />I&#39;ll look at the guide you suggested.<br />Thank you
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Loki66)</author>
		<pubDate>Mon, 02 Sep 2019 09:08:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="https://en.wikipedia.org/wiki/Computer_animation">https://en.wikipedia.org/wiki/Computer_animation</a></p><p>Please describe your problem exactly.</p><p>Is it <a href="https://en.wikipedia.org/wiki/Screen_tearing">tearing</a>?</p><p>Is it jerking?</p><p>Is it teleporting across the screen?</p><p>Some people perceive things differently.</p><p>Also, if your timer is not synchronized with vsync, it will update during the middle of a screen redraw.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 02 Sep 2019 11:14:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>yes the image is tearing.<br />after reading the allegro.cc guide I added two lines<br />to the program I had attached:<br />/***************************************************************<br />    al_set_new_display_option(ALLEGRO_VSYNC, 1, ALLEGRO_REQUIRE);<br />and<br />    al_set_target_bitmap(al_get_backbuffer(display));<br />/****************************************************************</p><p>source code:</p><p>   timer = al_create_timer(1.0 / FPS);<br />   if(!timer) {<br />      fprintf(stderr, &quot;failed to create timer!\n&quot;);<br />      return -1;<br />   }<br />    al_set_new_display_option(ALLEGRO_VSYNC, 1, ALLEGRO_REQUIRE);<br />    display = al_create_display(SCREEN_W, SCREEN_H);<br />    if(!display) {<br />      fprintf(stderr, &quot;failed to create display!\n&quot;);<br />      al_destroy_timer(timer);<br />      return -1;<br />   }<br />    btm_handle_player = al_load_bitmap(&quot;handlePl.bmp&quot;);<br />    if(!btm_handle_player) {<br />    fprintf(stderr, &quot;failed to create handle bitmap!\n&quot;);<br />    }<br />    al_convert_mask_to_alpha(btm_handle_player,al_map_rgb(198,107,87));<br />    al_set_target_bitmap(al_get_backbuffer(display));</p><p>/***************************************************************************</p><p>but nothing has changed.</p><p>moreover the animation is not fluid, that is, the bitmap does a small one<br />pause between one frame and another.<br />the bitmap moves as if there was a small lag at each frame.<br />I hope I was more precise, my English<br />is a translation of the Italian language made with google translate
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Loki66)</author>
		<pubDate>Mon, 02 Sep 2019 12:31:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Jerking is caused by a delay in rendering. This could be caused by missing the vsync and hitting the next one. That would instantly halve your framerate, as well as make it jerky.</p><p>I compiled your program against Allegro 5.2.5 and it ran fine for me. It did jerk just a little bit at first, but smoothed out quickly.</p><p>If enabling vsync didn&#39;t do anything, then either your graphics card has vsync disabled (in which case al_create_display should return 0), or you&#39;re out of sync.</p><p>Try synchronizing your timer with the display.</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_wait_for_vsync"><span class="a">al_wait_for_vsync</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_start_timer"><span class="a">al_start_timer</span></a><span class="k2">(</span>timer<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 02 Sep 2019 20:53:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks dthompson and Edgar for this. This will help students to get started and I will not have to create a new template every time.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Doctor Cop)</author>
		<pubDate>Mon, 02 Sep 2019 22:04:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>PROBLEM SOLVED<br />I tried to change some settings of the Intel graphics card. I selected &quot;performance&quot; on general settings.<br />Now the animation is ok.<br />Allegro5 was not a responsibility<br />My notebook is old and tired<br />thank you all for your availability <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Loki66)</author>
		<pubDate>Mon, 02 Sep 2019 22:40:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Gotta love integrated graphics <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/617913/1043248#target">Doctor Cop</a> said:</div><div class="quote"><p>
Thanks dthompson and Edgar for this
</p></div></div><p>

No problem, it&#39;s what we do. (though Edgar does it far more.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Tue, 03 Sep 2019 13:30:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s because I refuse to let allegro.cc die. <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" /> <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" /> <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" /></p><p>:heart:</p><p><img src="http://www.allegro.cc/forums/smileys/kiss.gif" alt=":-*" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 03 Sep 2019 17:22:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>He&#39;s even making me post again ^^
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Tue, 03 Sep 2019 22:04:14 +0000</pubDate>
	</item>
</rss>
