SDL - fprintf to console instead of stdout.txt or stderr.txt February 05, 2010 04:07PM | Registered: 14 years ago Posts: 9 |
Re: SDL - fprintf to console instead of stdout.txt or stderr.txt February 05, 2010 04:42PM | Registered: 15 years ago Posts: 703 |
Re: SDL - fprintf to console instead of stdout.txt or stderr.txt February 05, 2010 04:49PM | Registered: 14 years ago Posts: 9 |
Re: SDL - fprintf to console instead of stdout.txt or stderr.txt February 06, 2010 08:56AM | Registered: 15 years ago Posts: 703 |
CON_Init(xfb[0],20,20,vmode->fbWidth,vmode->xfbHeight,vmode->fbWidth*VI_DISPLAY_PIX_SZ);
Re: SDL - fprintf to console instead of stdout.txt or stderr.txt February 06, 2010 12:40PM | Registered: 14 years ago Posts: 234 |
Re: SDL - fprintf to console instead of stdout.txt or stderr.txt February 06, 2010 01:23PM | Registered: 14 years ago Posts: 9 |
Re: SDL - fprintf to console instead of stdout.txt or stderr.txt February 07, 2010 01:30AM | Registered: 14 years ago Posts: 9 |
//---------- INIT SDL LIBRARIES if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0 ) { fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError() ); SDL_Delay( 5000 ); exit(EXIT_FAILURE); } rmode = VIDEO_GetPreferredMode(NULL); xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); CON_Init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); for(int i = 0; i < 100; i++) printf("Hello!\n"); // button initialization WPAD_Init(); // make sure SDL cleans up before exit atexit(SDL_Quit); SDL_ShowCursor(SDL_DISABLE); //---------- INIT DISPLAY screen = SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF); if ( !screen ) { fprintf(stderr, "Unable to set video: %s\n", SDL_GetError()); SDL_Delay( 5000 ); exit(EXIT_FAILURE); } //---------- INIT AUDIO if( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 4096 ) == -1 ) { fprintf(stderr, "Unable to start mixer: %s\n", SDL_GetError()); SDL_Delay( 5000 ); exit(EXIT_FAILURE); }
Re: SDL - fprintf to console instead of stdout.txt or stderr.txt February 07, 2010 03:45AM | Registered: 15 years ago Posts: 703 |