SDLNet and console applications

I was going to do a tcp chat server thing-a-ma-jig, but after
including the SDLNet library, all my console text is directed to the
’stdout.txt’ file…

is there any way to redirect the text back to the console window?
would ‘SDL_WM_GrabInput()’ work? I’m not setting any video mode, so I
don’t know if it would work specifically.

has any one else had this problem?

Alex~–
Smith: "…Why, Mr Anderson, Why - Do - You - Persist?"
Neo: “Because I choose to.”
-Matrix Revolutions

Alex Barry wrote:

I was going to do a tcp chat server thing-a-ma-jig, but after
including the SDLNet library, all my console text is directed to the
’stdout.txt’ file…

is there any way to redirect the text back to the console window?
would ‘SDL_WM_GrabInput()’ work? I’m not setting any video mode, so I
don’t know if it would work specifically.

has any one else had this problem?

Alex~


Smith: "…Why, Mr Anderson, Why - Do - You - Persist?"
Neo: “Because I choose to.”
-Matrix Revolutions


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Two possible scenarios will fix this:

  1. Recompile the SDLmain library with NO_STDIO_REDIRECT #define’d.
  2. Re-write your main() with the functionality from
    SDL\src\main\win32\SDL_win32_main.c’s console_main() function, make sure
    you “#undef main” before your main() function, and don’t link with the
    SDLmain library.

There has to be a better way than library-compile-time #define’s, but
its probably way less clean than what is there (not to say what is there
is really that clean to begin with). If anyone else has more time than
me, or has tried it in the past, is there any major reason this can’t be
promoted to a run-time option (vis-a-vis a environment variable, or a
boolean flag)?

  • Silicon