Function DebugConsole

Synopsis

#include <Source/Falcor/Utils/Debug/DebugConsole.h>

DebugConsole(bool waitForKey=true)

Description

Opens a console window. The destructor closes it again.

Parameters

[ in ] waitForKey - If true, the console waits for a key press before closing.

Source

Lines 43-65 in Source/Falcor/Utils/Debug/DebugConsole.h.

DebugConsole(bool waitForKey = true)
    : mWaitForKey(waitForKey)
{
    // Open console window
    AllocConsole();
    // Redirect cout/cerr/cin streams to our console window
    mPrevCout = std::cout.rdbuf();
    mCout.open("CONOUT$");
    std::cout.rdbuf(mCout.rdbuf());
    mPrevCerr = std::cerr.rdbuf();
    mCerr.open("CONERR$");
    std::cerr.rdbuf(mCerr.rdbuf());
    mPrevCin = std::cin.rdbuf();
    mCin.open("CONIN$");
    std::cin.rdbuf(mCin.rdbuf());
    // Redirect stdout for printf() to our console
    //freopen_s(&mFp, "CONOUT$", "w", stdout);
    //std::cout.clear();
}





Add Discussion as Guest

Log in