<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Komische Frametimevariation]]></title><description><![CDATA[<p>Hallo an Alle!</p>
<p>Ich bin neu hier und hoffe, dass das der richtige Berecih für meine Frage ist.</p>
<p>Also ich schreibe an einem 3D-Spiel und habe festgestellt, dass die Framedauer in etwa alle 20-50 Frames 10 mal länger ist als sonst.<br />
Zum Test hab ich folgendes Minimalprogramm geschrieben und auch da das Gleiche.<br />
Alle 20-50 Durchläufe dauert ein Durchlauf ca. 0.01s und sonst ca. 0.001s .</p>
<pre><code>#include &quot;stdafx.h&quot;
#include &lt;iostream&gt;
#include &lt;GL/glfw.h&gt;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
	float lasttime,frametime=0;
	 if( !glfwInit() )
	{
		fprintf( stderr, &quot;Failed to initialize GLFW\n&quot; );
		return false;
	}

	 bool running=true;
	 lasttime = glfwGetTime();
	 while (running)
	 {
		 frametime=glfwGetTime()-lasttime;
		 lasttime=glfwGetTime();
		 cout &lt;&lt; &quot;frametime= &quot;&lt;&lt; frametime &lt;&lt; endl;
	 }
}
</code></pre>
<p>Ich benutze Visual C++ 2010 Express und zur Zeitberechung die OpenGL-Bibliothek glfw.</p>
<p>Hat jemand eine Idee, woran das liegen könnte?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/315099/komische-frametimevariation</link><generator>RSS for Node</generator><lastBuildDate>Fri, 31 Jul 2026 11:52:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/315099.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 23 Mar 2013 18:56:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Komische Frametimevariation on Sat, 23 Mar 2013 18:56:01 GMT]]></title><description><![CDATA[<p>Hallo an Alle!</p>
<p>Ich bin neu hier und hoffe, dass das der richtige Berecih für meine Frage ist.</p>
<p>Also ich schreibe an einem 3D-Spiel und habe festgestellt, dass die Framedauer in etwa alle 20-50 Frames 10 mal länger ist als sonst.<br />
Zum Test hab ich folgendes Minimalprogramm geschrieben und auch da das Gleiche.<br />
Alle 20-50 Durchläufe dauert ein Durchlauf ca. 0.01s und sonst ca. 0.001s .</p>
<pre><code>#include &quot;stdafx.h&quot;
#include &lt;iostream&gt;
#include &lt;GL/glfw.h&gt;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
	float lasttime,frametime=0;
	 if( !glfwInit() )
	{
		fprintf( stderr, &quot;Failed to initialize GLFW\n&quot; );
		return false;
	}

	 bool running=true;
	 lasttime = glfwGetTime();
	 while (running)
	 {
		 frametime=glfwGetTime()-lasttime;
		 lasttime=glfwGetTime();
		 cout &lt;&lt; &quot;frametime= &quot;&lt;&lt; frametime &lt;&lt; endl;
	 }
}
</code></pre>
<p>Ich benutze Visual C++ 2010 Express und zur Zeitberechung die OpenGL-Bibliothek glfw.</p>
<p>Hat jemand eine Idee, woran das liegen könnte?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2309127</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2309127</guid><dc:creator><![CDATA[pseudosepp]]></dc:creator><pubDate>Sat, 23 Mar 2013 18:56:01 GMT</pubDate></item><item><title><![CDATA[Reply to Komische Frametimevariation on Sat, 23 Mar 2013 18:59:26 GMT]]></title><description><![CDATA[<p>Hintergrundprozesse duerfen auch mal Rechenzeit bekommen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2309130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2309130</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Sat, 23 Mar 2013 18:59:26 GMT</pubDate></item><item><title><![CDATA[Reply to Komische Frametimevariation on Sat, 23 Mar 2013 19:07:13 GMT]]></title><description><![CDATA[<p>Erst mal Danke für die schnelle Antwort.</p>
<p>Das mit den Hintergrundprozessen ist natürlich logisch.<br />
Nur sollte doch dann bei konstanten Hintergrundprozessen auch immer ca. die selbe Zeit (also ca. 1/100s)addiert werden.<br />
Allerdings verzehnfacht sich ja die Dauer immer, egal wie lange der Schleifeninhalt dauert.<br />
Also bei dem großen Programm dauert ein Frame normalerweise 1/100s und bei den Schwankungen dann nicht 2/100s, sondern eben 1/10s , was dann zu Ruckeln führt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2309133</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2309133</guid><dc:creator><![CDATA[pseudosepp]]></dc:creator><pubDate>Sat, 23 Mar 2013 19:07:13 GMT</pubDate></item><item><title><![CDATA[Reply to Komische Frametimevariation on Sat, 23 Mar 2013 19:10:05 GMT]]></title><description><![CDATA[<p>Die Zeitdifferenz kann auch durch Addition entstanden sein, nicht durch Multiplikation. Und bei konstanter Hintergrundlast bleibt die Rechenzeit auch constant, egal wie gross dein Spiel ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2309135</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2309135</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Sat, 23 Mar 2013 19:10:05 GMT</pubDate></item><item><title><![CDATA[Reply to Komische Frametimevariation on Sat, 23 Mar 2013 19:15:22 GMT]]></title><description><![CDATA[<p>Ok, danke erstmal,</p>
<p>nur bleibt sie ja eben nicht konstant, und beim kleinen programm springt sie von 1/1000 auf 1/100, also ca PLUS 1/100 und MAL 10,<br />
beim großen Programm springt sie von 1/100 auf 1/10, also ca PLUS 1/10 und MAL 10<br />
(bei der selben Hintergrunbelastung).</p>
<p>Also wird die Framedauer ja augenscheinlich alle 20-50 Frames mit 10 multipliziert, und das verstehe ich nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2309139</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2309139</guid><dc:creator><![CDATA[pseudosepp]]></dc:creator><pubDate>Sat, 23 Mar 2013 19:15:22 GMT</pubDate></item></channel></rss>