• Two windows with sdl at the same time? Second window for debug info?[C++]
    10 replies, posted
Is it possible to have two windows when using SDL and having the second one for displaying debug info? I'm using C++ and Ms VS2010.
You could attach a console. Just set the project type to console application in the properties. In order to have two 3D windows from the same Direct3D device, (I.e. So you don't have to re-load all of your resources such as fonts and the like for a second device.) you have to create both windows then create a swap chain for each. (The first swap chain is created automatically when you create the device.) I've never used SDL and don't know it's capabilities so I'm just speaking about the general method for raw DirectX.
AllocConsole(); I believe sauce.
[QUOTE=yngndrw;26095188]You could attach a console. Just set the project type to console application in the properties. In order to have two 3D windows from the same Direct3D device, (I.e. So you don't have to re-load all of your resources such as fonts and the like for a second device.) you have to create both windows then create a swap chain for each. (The first swap chain is created automatically when you create the device.) I've never used SDL and don't know it's capabilities so I'm just speaking about the general method for raw DirectX.[/QUOTE] SDL is a cross platform media library, it uses OpenGL, not Direct3D.
Ah, it seems that OpenGL doesn't share the swap chain concept either. However it seems less messing about is required in OpenGL - It's nearly the same method than you'd do split-screen: (I.e: Very simple - Render first, change window (Or viewport for split-screen.), render second.) [url]http://www.gamedev.net/community/forums/topic.asp?topic_id=75695&whichpage=1&#374448[/url]
Well, for just a console and to redirect stdout to it's: [cpp] void RedirectStdOut(void) { CONSOLE_SCREEN_BUFFER_INFO csbi; // Create a new console window. if (!AllocConsole()) return; // Set the screen buffer to be larger than normal (this is optional). if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) { csbi.dwSize.Y = 1000; // any useful number of lines... SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), csbi.dwSize); } // Redirect "stdin" to the console window. if (!freopen("CONIN$", "w", stdin)) return; // Redirect "stderr" to the console window. if (!freopen("CONOUT$", "w", stderr)) return; // Redirect "stdout" to the console window. if (!freopen("CONOUT$", "w", stdout)) return; // Turn off buffering for "stdout" ("stderr" is unbuffered by default). setbuf(stdout, NULL); } [/cpp] Cant remember where i found that
Put that in code tags and also you have some spaces that do not need to be there
[QUOTE=Vbits;26101266]Put that in code tags and also you have some spaces that do not need to be there[/QUOTE] what do you use for code tags? And the spaces dont exactly need to not be there do they?
[code ] and [/code ] without the spaces
[QUOTE=Vbits;26101609][code ] and [/code ] without the spaces[/QUOTE] You can use "[noparse][noparse][/noparse][/noparse]" to write the tags without spaces. [cpp]/* Also, "cpp" tags are best for c++! */[/cpp]
Yeah I tried that but there was a spelling mistake.
Sorry, you need to Log In to post a reply to this thread.