From: Braden M. <br...@us...> - 2006-08-31 21:19:08
|
Update of /cvsroot/openvrml/openvrml/examples In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14810/examples Modified Files: Tag: OpenVRML-0_16-BRANCH sdl_viewer.cpp Log Message: Allocate a console and direct stdout and stderr to it on Windows. Index: sdl_viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/examples/sdl_viewer.cpp,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** sdl_viewer.cpp 6 Mar 2006 19:26:33 -0000 1.10 --- sdl_viewer.cpp 31 Aug 2006 21:18:57 -0000 1.10.2.1 *************** *** 31,34 **** --- 31,37 ---- # include <openvrml/browser.h> # include <openvrml/gl/viewer.h> + # ifdef _WIN32 + # include <windows.h> + # endif extern "C" Uint32 update_timer_callback(Uint32 interval, void * param); *************** *** 84,87 **** --- 87,97 ---- using std::endl; + # ifdef _WIN32 + AllocConsole(); + FILE * out; + freopen_s(&out, "conout$", "w", stdout); + freopen_s(&out, "conout$", "w", stderr); + # endif + if (argc < 2) { cerr << "Usage: " << argv[0] << " URL" << endl; *************** *** 109,112 **** --- 119,127 ---- } + # ifdef _WIN32 + fclose(out); + FreeConsole(); + # endif + return EXIT_SUCCESS; } |