<?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[in Konsole schreiben bei Benutzung von SDL]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich teste mich gerade ein bisschen durch die SDL-Funktionen...</p>
<p>Jetzt wollte ich ein SDL-Fenster öffnen, darin ein Bild anzeigen lassen und in die Konsole ein Paar Sachen schreiben.</p>
<p>Leider kommt in der Konsole nichts an davon <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Alle &quot;cout&quot;-Befehle in meinem Code sind in der Konsole nicht sichtbar...<br />
weiß jemand warum?</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;SDL/SDL.h&quot;

using namespace std;

//The attributes of the screen
const int SCREEN_WIDTH = 1280;  // Hier wird die Größe des Ausgabebildschirms festgelegt....
const int SCREEN_HEIGHT = 960;
const int SCREEN_BPP = 32;  //SCREEN_BPP is the bits per-pixel. In all of the tutorials, 32-bit color will be used.
float time1, time2, time_gesamt;

SDL_Surface *screen, *osito_vorne = NULL; // Pointer auf Null setzen
SDL_Rect dest;

 int main( int argc, char* args[] ) // SDL brauch diese Parameter
{
    cout &lt;&lt; &quot;hallo&quot; &lt;&lt; endl; // Wie schreib ich in die Konsole?
    SDL_Init ( SDL_INIT_EVERYTHING );
    screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE );
    SDL_WM_SetCaption( &quot;Hello World&quot;, NULL );
    osito_vorne = SDL_LoadBMP(&quot;osito_vorne.bmp&quot;);

    // Definimos donde dibujaremos el gráfico
    // y lo copiamos a la pantalla.
    dest.x = 100;
    dest.y = 100;
    dest.w = osito_vorne-&gt;w;
    dest.h = osito_vorne-&gt;h;
    SDL_BlitSurface(osito_vorne, NULL, screen, &amp;dest);

    cout &lt;&lt; &quot;Test&quot; &lt;&lt; endl;
    // Mostramos la pantalla
    SDL_Flip(screen);

    time1 = SDL_GetTicks();
    SDL_Delay( 2000 );
    time2 = SDL_GetTicks();
    time_gesamt = time2 - time1;
    cout &lt;&lt; time_gesamt &lt;&lt; endl;

    SDL_Quit();
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/252241/in-konsole-schreiben-bei-benutzung-von-sdl</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 02:20:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/252241.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 Oct 2009 17:42:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to in Konsole schreiben bei Benutzung von SDL on Fri, 16 Oct 2009 17:42:30 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich teste mich gerade ein bisschen durch die SDL-Funktionen...</p>
<p>Jetzt wollte ich ein SDL-Fenster öffnen, darin ein Bild anzeigen lassen und in die Konsole ein Paar Sachen schreiben.</p>
<p>Leider kommt in der Konsole nichts an davon <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Alle &quot;cout&quot;-Befehle in meinem Code sind in der Konsole nicht sichtbar...<br />
weiß jemand warum?</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;SDL/SDL.h&quot;

using namespace std;

//The attributes of the screen
const int SCREEN_WIDTH = 1280;  // Hier wird die Größe des Ausgabebildschirms festgelegt....
const int SCREEN_HEIGHT = 960;
const int SCREEN_BPP = 32;  //SCREEN_BPP is the bits per-pixel. In all of the tutorials, 32-bit color will be used.
float time1, time2, time_gesamt;

SDL_Surface *screen, *osito_vorne = NULL; // Pointer auf Null setzen
SDL_Rect dest;

 int main( int argc, char* args[] ) // SDL brauch diese Parameter
{
    cout &lt;&lt; &quot;hallo&quot; &lt;&lt; endl; // Wie schreib ich in die Konsole?
    SDL_Init ( SDL_INIT_EVERYTHING );
    screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE );
    SDL_WM_SetCaption( &quot;Hello World&quot;, NULL );
    osito_vorne = SDL_LoadBMP(&quot;osito_vorne.bmp&quot;);

    // Definimos donde dibujaremos el gráfico
    // y lo copiamos a la pantalla.
    dest.x = 100;
    dest.y = 100;
    dest.w = osito_vorne-&gt;w;
    dest.h = osito_vorne-&gt;h;
    SDL_BlitSurface(osito_vorne, NULL, screen, &amp;dest);

    cout &lt;&lt; &quot;Test&quot; &lt;&lt; endl;
    // Mostramos la pantalla
    SDL_Flip(screen);

    time1 = SDL_GetTicks();
    SDL_Delay( 2000 );
    time2 = SDL_GetTicks();
    time_gesamt = time2 - time1;
    cout &lt;&lt; time_gesamt &lt;&lt; endl;

    SDL_Quit();
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1793541</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793541</guid><dc:creator><![CDATA[Barcelona]]></dc:creator><pubDate>Fri, 16 Oct 2009 17:42:30 GMT</pubDate></item><item><title><![CDATA[Reply to in Konsole schreiben bei Benutzung von SDL on Fri, 16 Oct 2009 19:13:52 GMT]]></title><description><![CDATA[<p>Has du's schon mal mit &quot;printf&quot; probiert ?</p>
<p>Aus &quot;stdio.h&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793576</guid><dc:creator><![CDATA[DarkShadow44]]></dc:creator><pubDate>Fri, 16 Oct 2009 19:13:52 GMT</pubDate></item><item><title><![CDATA[Reply to in Konsole schreiben bei Benutzung von SDL on Fri, 16 Oct 2009 20:02:32 GMT]]></title><description><![CDATA[<p>SDL leitet die Standardausgabe in Dateien um. Schau mal in den Ordner der .exe-Datei (oder das Projektverzeichnis, wenn du von einer IDE aus startest). Dort sollte sich die Datei &quot;stdout.txt&quot; befinden, welche deinen Output enthält.</p>
<p>Wie das verhindert werden kann, weiss ich allerdings auch nicht gerade - aber das Problem liegt bei SDL.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793596</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Fri, 16 Oct 2009 20:02:32 GMT</pubDate></item><item><title><![CDATA[Reply to in Konsole schreiben bei Benutzung von SDL on Fri, 16 Oct 2009 21:32:01 GMT]]></title><description><![CDATA[<p>wohl eher am windowsport von SDL, denn unter Linux funktioniert das mit der Konsole eigentlich immer. Vielleicht ist aber auch die IDE schuld, dass die die Ausgabe sobald ein Fenster da ist automatisch in eine Datei umleitet, das ist aber nur spekulation.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793619</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793619</guid><dc:creator><![CDATA[Krux]]></dc:creator><pubDate>Fri, 16 Oct 2009 21:32:01 GMT</pubDate></item><item><title><![CDATA[Reply to in Konsole schreiben bei Benutzung von SDL on Fri, 16 Oct 2009 21:46:43 GMT]]></title><description><![CDATA[<p>Nexus schrieb:</p>
<blockquote>
<p>SDL leitet die Standardausgabe in Dateien um. Schau mal in den Ordner der .exe-Datei (oder das Projektverzeichnis, wenn du von einer IDE aus startest). Dort sollte sich die Datei &quot;stdout.txt&quot; befinden, welche deinen Output enthält.</p>
<p>Wie das verhindert werden kann, weiss ich allerdings auch nicht gerade - aber das Problem liegt bei SDL.</p>
</blockquote>
<p>Hast Recht, ist alles in eine Datei namens &quot;stdout.txt&quot; umgeleitet worden...</p>
<p>Das erste cout schreibe ich allerdings bevor ich überhaupt das SDL-Fenster öffne, und das landet trotzdem in der Datei und nicht in der Konsole... sehr merkwürdig.</p>
<p>Danke für die Antworten! Wenn wer noch weiteres dazu weiß, nur heraus damit <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793626</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793626</guid><dc:creator><![CDATA[Barcelona]]></dc:creator><pubDate>Fri, 16 Oct 2009 21:46:43 GMT</pubDate></item><item><title><![CDATA[Reply to in Konsole schreiben bei Benutzung von SDL on Sat, 17 Oct 2009 12:04:36 GMT]]></title><description><![CDATA[<p>Vermutlich ruft SDL intern WinMain auf. Ein AllocConsole könnte hier vllt. helfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793775</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793775</guid><dc:creator><![CDATA[ich++]]></dc:creator><pubDate>Sat, 17 Oct 2009 12:04:36 GMT</pubDate></item><item><title><![CDATA[Reply to in Konsole schreiben bei Benutzung von SDL on Sat, 17 Oct 2009 15:05:51 GMT]]></title><description><![CDATA[<p>Krux schrieb:</p>
<blockquote>
<p>wohl eher am windowsport von SDL, denn unter Linux funktioniert das mit der Konsole eigentlich immer. Vielleicht ist aber auch die IDE schuld, dass die die Ausgabe sobald ein Fenster da ist automatisch in eine Datei umleitet, das ist aber nur spekulation.</p>
</blockquote>
<p>Nein, das macht SDL.<br />
&quot;--disable-stdio-redirect&quot;<br />
Ist die Option die Du suchst.. zumindest für Linux bzw MSys <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 />
lg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793869</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793869</guid><dc:creator><![CDATA[C++R00ki3]]></dc:creator><pubDate>Sat, 17 Oct 2009 15:05:51 GMT</pubDate></item></channel></rss>