|
Sam Roberts wrote:
On Mon, Feb 16, 2009 at 8:00 PM, Wesley Smith <wesley.hoke@gmail.com> wrote:The lua.exe wrapper does, and you could add a "-O file" option to it to cause it to freopen() stdout (and stderr).Have you tried this with a windows windowed application? I've not been able to get any kind of stdout redirection on windows without generating a console within the app. The console is not the most aesthetically pleasing nor flexible widget and I'd like to avoid it.
FLOSS code is your friend, look at SDL, it does exactly what you want. Note for recent versions, it can be compiled as either console output or the olde redirect, but as long as you use the latter and link your app as a windowed app, it should be fine, you won't get a console popping up. The code for the SDL 1.2 branch I think is in src/main/win32/SDL_win32_main.c.
[snip snip] If you want to embed lua in a windows application you would want to avoid stdio and the console entirely, wouldn't you? And just define print() to put stuff in some kind of scrolling text widget, or whatever you prefer to the console?
-- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia