Howto display error

I’m working in VC 6.0 WIN2000, and I want to use SDL_VIDEO to load BMP file as turial shows.

SDL_Surface *image;
image=SDL_LoadBMP("c:\1.bmp");
if(image==NULL){
	fprintf(stderr,"Unable to load BMPfile: %s\n",SDL_GetError());
	exit(1);
}
if(image->format->palette&&screen->format->palette){
	SDL_SetColors(screen,image->format->palette->colors,0,image->format->palette->ncolors);
}
if(SDL_BlitSurface(image,NULL,screen,NULL)<0){
	fprintf(stderr,"Unable to display BMPfile: %s\n",SDL_GetError());
	exit(1);
}
SDL_UpdateRect(screen,0,0,image->w,image->h);
SDL_FreeSurface(image);

but I get only black screen, and I dont know howto get error message as beyong SDL_GetError().
???hu
???@hu1
???2002-11-21

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I’m working in VC 6.0 WIN2000, and I want to use SDL_VIDEO to load BMP
file as turial shows.
[snip]
image=SDL_LoadBMP(“c:\1.bmp”);

You need to escape the backslash, like so: “c:\1.bmp”. BTW, most Windows
file functions seem to be quite happy dealing with forward slashes, so
"c:/1.bmp" probably works as well, and you don’t need to escape anything.

[snip]

but I get only black screen, and I dont know howto get error message as
beyong SDL_GetError(). hu

If you build as Windows Application, everything you printf() or
fprintf(stderr, …) will be redirected into a file called stdout.txt or
stderr.txt, respectively.

And yes, an SDL_ShowError() function would be useful :wink:

cu,
Nicolai
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE93O6ZsxPozBga0lwRAtZyAJ4uz8OREBnJzOqrqOwdI1N+bYvudgCg2dp6
mLvHW4ewDzt9pyPZsAYDgtQ=
=ukf1
-----END PGP SIGNATURE-----On Thursday 21 November 2002 04:42, hu wrote: