2008年12月25日 星期四

Make SDL program to have console output instead of stdout.txt and stderr.txt under Windows

SDL_Init() routes stdout and stderr to the respective files. You can revert this by adding the following lines after the call to SDL_Init in your code:

freopen( "CON", "w", stdout );
freopen( "CON", "w", stderr );

* If that doesn't work try adding these 2 lines at the very beginning of your code (SDL_Init wrapper or in top of your main)

int main( int argc, char *argv[] )

沒有留言: