<?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[Objekt Instanz erstellen, aber wie?]]></title><description><![CDATA[<p>Hallo,<br />
ich versuche gerade mit dem SLD-Wrapper SDLmm umzugehen.<br />
Jetzt steht in der Doku:<br />
<a href="http://sdlmm.sourceforge.net/classSDLmm_1_1Display.html" rel="nofollow">http://sdlmm.sourceforge.net/classSDLmm_1_1Display.html</a></p>
<blockquote>
<p>Protected Methods<br />
Display&amp; operator= (Display &amp;)<br />
Dummy implementation of operator=() to stop initialization. More...</p>
<p>Display (Display &amp;)<br />
Display ()<br />
A NOOP constructor. More...</p>
</blockquote>
<p>und</p>
<blockquote>
<p>Static Public Methods<br />
Display&amp; GetDisplay ()<br />
The one and only display. More...</p>
</blockquote>
<p>Sprich, der Konstruktor ist Protected und eine Methode GetDisplay soll eine<br />
Referenz auf das Objekt zurückgeben.</p>
<p>Wenn ich jetzt im Programm schreibe:</p>
<pre><code class="language-cpp">SDLmm::Display disp = SDLmm::Display::GetDisplay();
</code></pre>
<p>kommt ein Fehler. Was eigentlich klar ist da das Objekt &quot;disp&quot; erst existieren muß bevor es von GetDisplay verwendet werden kann.<br />
Wie kann ich ein Objekt von Display erstellen? Ist das so eine Arte Singelton?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/221994/objekt-instanz-erstellen-aber-wie</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Oct 2026 18:37:49 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/221994.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 06 Sep 2008 07:34:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Objekt Instanz erstellen, aber wie? on Sat, 06 Sep 2008 07:34:29 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich versuche gerade mit dem SLD-Wrapper SDLmm umzugehen.<br />
Jetzt steht in der Doku:<br />
<a href="http://sdlmm.sourceforge.net/classSDLmm_1_1Display.html" rel="nofollow">http://sdlmm.sourceforge.net/classSDLmm_1_1Display.html</a></p>
<blockquote>
<p>Protected Methods<br />
Display&amp; operator= (Display &amp;)<br />
Dummy implementation of operator=() to stop initialization. More...</p>
<p>Display (Display &amp;)<br />
Display ()<br />
A NOOP constructor. More...</p>
</blockquote>
<p>und</p>
<blockquote>
<p>Static Public Methods<br />
Display&amp; GetDisplay ()<br />
The one and only display. More...</p>
</blockquote>
<p>Sprich, der Konstruktor ist Protected und eine Methode GetDisplay soll eine<br />
Referenz auf das Objekt zurückgeben.</p>
<p>Wenn ich jetzt im Programm schreibe:</p>
<pre><code class="language-cpp">SDLmm::Display disp = SDLmm::Display::GetDisplay();
</code></pre>
<p>kommt ein Fehler. Was eigentlich klar ist da das Objekt &quot;disp&quot; erst existieren muß bevor es von GetDisplay verwendet werden kann.<br />
Wie kann ich ein Objekt von Display erstellen? Ist das so eine Arte Singelton?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577397</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577397</guid><dc:creator><![CDATA[Ovaron123]]></dc:creator><pubDate>Sat, 06 Sep 2008 07:34:29 GMT</pubDate></item><item><title><![CDATA[Reply to Objekt Instanz erstellen, aber wie? on Sat, 06 Sep 2008 07:45:54 GMT]]></title><description><![CDATA[<p>Ich wuerd jetzt einfach mal auf</p>
<pre><code>SDLmm::Display::GetDisplay (  	).eineMethode()
</code></pre>
<p>tippen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577400</guid><dc:creator><![CDATA[sdlmm]]></dc:creator><pubDate>Sat, 06 Sep 2008 07:45:54 GMT</pubDate></item><item><title><![CDATA[Reply to Objekt Instanz erstellen, aber wie? on Sat, 06 Sep 2008 07:55:55 GMT]]></title><description><![CDATA[<p>hast du SDLmm::Display::Init() aufgerufen und den rückgabewert überprüft?</p>
<p>ansonsten: mach uns das leben leichter und poste den code, der nicht geht...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577402</guid><dc:creator><![CDATA[ghorst]]></dc:creator><pubDate>Sat, 06 Sep 2008 07:55:55 GMT</pubDate></item><item><title><![CDATA[Reply to Objekt Instanz erstellen, aber wie? on Sat, 06 Sep 2008 07:59:15 GMT]]></title><description><![CDATA[<p>Danke, das funktioniert. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Da muß man aber immer viel tippen.. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /><br />
Z.b.</p>
<pre><code class="language-cpp">SDLmm::Display::GetDisplay().SetVideoMode(640,480,32,SDL_FULLSCREEN|SDL_SWSURFACE);
</code></pre>
<p>Rückgabewert von Init() ist Bool.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577404</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577404</guid><dc:creator><![CDATA[Ovaron123]]></dc:creator><pubDate>Sat, 06 Sep 2008 07:59:15 GMT</pubDate></item><item><title><![CDATA[Reply to Objekt Instanz erstellen, aber wie? on Sat, 06 Sep 2008 08:03:19 GMT]]></title><description><![CDATA[<p>Dafuer kann man z.B ein Macro oder eine Funktion benutzen.</p>
<pre><code class="language-cpp">Display &amp; GetDisplay()
{
 return SDLmm::Display::GetDisplay()
}

//oder

#define GetDisplay SDLmm::Display::GetDisplay()
</code></pre>
<p>Das is aber jedem selbst ueberlassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577406</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577406</guid><dc:creator><![CDATA[sdlmm]]></dc:creator><pubDate>Sat, 06 Sep 2008 08:03:19 GMT</pubDate></item><item><title><![CDATA[Reply to Objekt Instanz erstellen, aber wie? on Sat, 06 Sep 2008 09:07:43 GMT]]></title><description><![CDATA[<p>Oder das benuten, was dafür gedacht ist. using.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577432</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577432</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sat, 06 Sep 2008 09:07:43 GMT</pubDate></item><item><title><![CDATA[Reply to Objekt Instanz erstellen, aber wie? on Sat, 06 Sep 2008 09:25:33 GMT]]></title><description><![CDATA[<p>Oder du speicherst dir eine Referenz auf das Objekt (das geht nämlich auch ohne Kopierkonstruktor), so mach ich das immer:</p>
<pre><code class="language-cpp">SDLmm::Display&amp; disp = SDLmm::Display::GetDisplay();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1577441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577441</guid><dc:creator><![CDATA[.filmor]]></dc:creator><pubDate>Sat, 06 Sep 2008 09:25:33 GMT</pubDate></item></channel></rss>