<?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[Funktion verbraucht permanent Speicher]]></title><description><![CDATA[<p>Kann mir jemand sagen, wiso diese Funktion permanent Speicher frisst ?</p>
<pre><code>void CPlanetModel::Render_Surface(D3DXMATRIX* pTransformationsMatrix, long &amp;SurfaceTextureNr, D3DXVECTOR3 Ortsvektor)
{
	D3DXVECTOR3	Vec;

	Vec.x = v_sonnensystem-&gt;SunPosition.x - Ortsvektor.x;
	Vec.y = v_sonnensystem-&gt;SunPosition.y - Ortsvektor.y;
	Vec.z = v_sonnensystem-&gt;SunPosition.z - Ortsvektor.z;

	v_mathe-&gt;Normalize3DVector_If_Necessary(&amp;Vec,&amp;Vec);
	float Winkelx = sin(Vec.x);
	float Winkely = sin(Vec.y);
	float Winkelz = sin(Vec.z);

	D3DXMatrixIdentity(&amp;Rotationsmatrix);

	v_mathe-&gt;CalcRotXMatrix(&amp;tempMatrix3, Winkelx-1.3f);
	v_mathe-&gt;CalcRotYMatrix(&amp;tempMatrix2, Winkely);
	v_mathe-&gt;CalcRotZMatrix(&amp;tempMatrix1, Winkelz+1.5f);
	Rotationsmatrix = Rotationsmatrix*tempMatrix1*tempMatrix2*tempMatrix3;

	Transformationsmatrix = *pTransformationsMatrix;

	D3DXMATRIX matWorldViewProjection = Transformationsmatrix * matView * matProj;

	EffectPlanet-&gt;SetMatrix(&quot;matWorldViewProjection&quot;, &amp;matWorldViewProjection);
	EffectPlanet-&gt;SetMatrix(&quot;matRotation&quot;, &amp;Rotationsmatrix);

	// Richtung der Sonne (umgekehrte Ausbreitungsrichtung des Sonnenlichts):
	tempVektor3 = D3DXVECTOR3(0.0f, 1.0f, 0.0f);

	// Umgekehrte Ausbreitungsrichtung des Lichts an den Vertex Shader übergeben:
	EffectPlanet-&gt;SetVector(&quot;negLightDir&quot;, &amp;D3DXVECTOR4(tempVektor3.x, tempVektor3.y, tempVektor3.z, 1.0f));

	// Himmels- und Bodenfarbe an den Vertex Shader übergeben: 
	EffectPlanet-&gt;SetVector(&quot;SkyColor&quot;, &amp;D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f));
	EffectPlanet-&gt;SetVector(&quot;GroundColor&quot;, &amp;D3DXVECTOR4(0.01f, 0.01f, 0.01f, 1.0f));

	// Eigenschaften der direktionalen Lichtquelle an den Vertex Shader übergeben:
	EffectPlanet-&gt;SetVector(&quot;LightIntensity_Ambient&quot;, &amp;D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f));	

	// Materialeigenschaften des Modells an den Vertex Shader übergeben:
	EffectPlanet-&gt;SetVector(&quot;MaterialReflectivity_Ambient&quot;, &amp;D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f));

	EffectPlanet-&gt;SetTexture(&quot;SkinTexture&quot;, PlanetaryTextures-&gt;SurfaceTexture[SurfaceTextureNr].pTexture);

	EffectPlanet-&gt;SetTechnique(&quot;T1&quot;);

	EffectPlanet-&gt;Begin(&amp;nPasses, 0);

	for (iPass=0; iPass&lt;nPasses; iPass++)
	{
		EffectPlanet-&gt;Pass(iPass);

		lpD3DDevice-&gt;SetStreamSource(0, PlanetVB, 0, sizeof(SPACEOBJEKT3DVERTEX));

		lpD3DDevice-&gt;SetFVF(D3DFVF_SPACEOBJEKT3DVERTEX);	

		lpD3DDevice-&gt;SetIndices(PlanetIB);  

		lpD3DDevice-&gt;DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0,
                                           0, NumVertices,
                                           0, NumTriangles);
	}

	EffectPlanet-&gt;End();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/124475/funktion-verbraucht-permanent-speicher</link><generator>RSS for Node</generator><lastBuildDate>Sun, 23 Aug 2026 23:42:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/124475.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Oct 2005 20:17:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktion verbraucht permanent Speicher on Thu, 27 Oct 2005 20:17:46 GMT]]></title><description><![CDATA[<p>Kann mir jemand sagen, wiso diese Funktion permanent Speicher frisst ?</p>
<pre><code>void CPlanetModel::Render_Surface(D3DXMATRIX* pTransformationsMatrix, long &amp;SurfaceTextureNr, D3DXVECTOR3 Ortsvektor)
{
	D3DXVECTOR3	Vec;

	Vec.x = v_sonnensystem-&gt;SunPosition.x - Ortsvektor.x;
	Vec.y = v_sonnensystem-&gt;SunPosition.y - Ortsvektor.y;
	Vec.z = v_sonnensystem-&gt;SunPosition.z - Ortsvektor.z;

	v_mathe-&gt;Normalize3DVector_If_Necessary(&amp;Vec,&amp;Vec);
	float Winkelx = sin(Vec.x);
	float Winkely = sin(Vec.y);
	float Winkelz = sin(Vec.z);

	D3DXMatrixIdentity(&amp;Rotationsmatrix);

	v_mathe-&gt;CalcRotXMatrix(&amp;tempMatrix3, Winkelx-1.3f);
	v_mathe-&gt;CalcRotYMatrix(&amp;tempMatrix2, Winkely);
	v_mathe-&gt;CalcRotZMatrix(&amp;tempMatrix1, Winkelz+1.5f);
	Rotationsmatrix = Rotationsmatrix*tempMatrix1*tempMatrix2*tempMatrix3;

	Transformationsmatrix = *pTransformationsMatrix;

	D3DXMATRIX matWorldViewProjection = Transformationsmatrix * matView * matProj;

	EffectPlanet-&gt;SetMatrix(&quot;matWorldViewProjection&quot;, &amp;matWorldViewProjection);
	EffectPlanet-&gt;SetMatrix(&quot;matRotation&quot;, &amp;Rotationsmatrix);

	// Richtung der Sonne (umgekehrte Ausbreitungsrichtung des Sonnenlichts):
	tempVektor3 = D3DXVECTOR3(0.0f, 1.0f, 0.0f);

	// Umgekehrte Ausbreitungsrichtung des Lichts an den Vertex Shader übergeben:
	EffectPlanet-&gt;SetVector(&quot;negLightDir&quot;, &amp;D3DXVECTOR4(tempVektor3.x, tempVektor3.y, tempVektor3.z, 1.0f));

	// Himmels- und Bodenfarbe an den Vertex Shader übergeben: 
	EffectPlanet-&gt;SetVector(&quot;SkyColor&quot;, &amp;D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f));
	EffectPlanet-&gt;SetVector(&quot;GroundColor&quot;, &amp;D3DXVECTOR4(0.01f, 0.01f, 0.01f, 1.0f));

	// Eigenschaften der direktionalen Lichtquelle an den Vertex Shader übergeben:
	EffectPlanet-&gt;SetVector(&quot;LightIntensity_Ambient&quot;, &amp;D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f));	

	// Materialeigenschaften des Modells an den Vertex Shader übergeben:
	EffectPlanet-&gt;SetVector(&quot;MaterialReflectivity_Ambient&quot;, &amp;D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f));

	EffectPlanet-&gt;SetTexture(&quot;SkinTexture&quot;, PlanetaryTextures-&gt;SurfaceTexture[SurfaceTextureNr].pTexture);

	EffectPlanet-&gt;SetTechnique(&quot;T1&quot;);

	EffectPlanet-&gt;Begin(&amp;nPasses, 0);

	for (iPass=0; iPass&lt;nPasses; iPass++)
	{
		EffectPlanet-&gt;Pass(iPass);

		lpD3DDevice-&gt;SetStreamSource(0, PlanetVB, 0, sizeof(SPACEOBJEKT3DVERTEX));

		lpD3DDevice-&gt;SetFVF(D3DFVF_SPACEOBJEKT3DVERTEX);	

		lpD3DDevice-&gt;SetIndices(PlanetIB);  

		lpD3DDevice-&gt;DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0,
                                           0, NumVertices,
                                           0, NumTriangles);
	}

	EffectPlanet-&gt;End();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/902276</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902276</guid><dc:creator><![CDATA[BlackWolf]]></dc:creator><pubDate>Thu, 27 Oct 2005 20:17:46 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion verbraucht permanent Speicher on Thu, 27 Oct 2005 21:28:16 GMT]]></title><description><![CDATA[<p>ich hab zwar nicht 100%ig verstanden was da vor sich geht, aber da du ja scheinbar nach einem Speicherleck suchst ist mir vor allem folgendes aufgefallen:</p>
<pre><code class="language-cpp">lpD3DDevice-&gt;SetStreamSource(0, PlanetVB, 0, sizeof(SPACEOBJEKT3DVERTEX));
</code></pre>
<p>Das sieht mir sehr danach aus, als ob irgendwo Ressourcen/Speicher angefordert werden (Schlagwort Source, sizeof()). Da ich keine entsprechende Freigaberoutine erkennen konnte, drängt sich mir als Laien der Verdacht auf, dass die Ressourcen nicht wieder freigegeben werden...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902319</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902319</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 27 Oct 2005 21:28:16 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion verbraucht permanent Speicher on Thu, 27 Oct 2005 21:32:24 GMT]]></title><description><![CDATA[<p>Frag mal im Spieleprogrammiererungsforum nach.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902320</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902320</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Thu, 27 Oct 2005 21:32:24 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion verbraucht permanent Speicher on Thu, 27 Oct 2005 23:19:10 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>ich hab zwar nicht 100%ig verstanden was da vor sich geht, aber da du ja scheinbar nach einem Speicherleck suchst ist mir vor allem folgendes aufgefallen:</p>
<pre><code class="language-cpp">lpD3DDevice-&gt;SetStreamSource(0, PlanetVB, 0, sizeof(SPACEOBJEKT3DVERTEX));
</code></pre>
<p>Das sieht mir sehr danach aus, als ob irgendwo Ressourcen/Speicher angefordert werden (Schlagwort Source, sizeof()). Da ich keine entsprechende Freigaberoutine erkennen konnte, drängt sich mir als Laien der Verdacht auf, dass die Ressourcen nicht wieder freigegeben werden...</p>
</blockquote>
<p>Ne, da wird kein Speicher angelegt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902344</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902344</guid><dc:creator><![CDATA[User---]]></dc:creator><pubDate>Thu, 27 Oct 2005 23:19:10 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion verbraucht permanent Speicher on Fri, 28 Oct 2005 04:29:35 GMT]]></title><description><![CDATA[<p>Was ist mit den ganzen Operatoren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902364</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Fri, 28 Oct 2005 04:29:35 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion verbraucht permanent Speicher on Fri, 28 Oct 2005 07:45:46 GMT]]></title><description><![CDATA[<p>Was genau ist denn &quot;EffectPlanet&quot;?<br />
In der Funktion selber sehe ich nichts, was Speicher fressen würde - also liegt es möglicherweise an einer der Funktionen, die du aufgerufen hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902466</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902466</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 28 Oct 2005 07:45:46 GMT</pubDate></item></channel></rss>