Advertisement

Copy SDL_Surface

Started by April 02, 2005 03:10 PM
5 comments, last by Rob Loach 19 years, 11 months ago
SDL_CreateRGBSurface(s->pixels , s->w , s->h , ?? , s->format->pitch , s->format->Rmask , s->format->Gmask , s->format->Bmask , s->format->Amask); how do i get an SDL_Surface's depth value?
s->format->BitsPerPixel
- Jezper Blixt
Advertisement
lol, thanks.
it seems, theres a problem. this piece of code does not copy 2 surfaces (excuse the mess)
	SDL_Surface *image0 = IMG_Load("vehicle.jpg");	SDL_Surface *image1 = 0;	SDL_Surface *isur = image0;	SDL_PixelFormat *ifmt = isur->format;	image1 = SDL_CreateRGBSurfaceFrom(isur->pixels , isur->w , isur->h ,		ifmt->BitsPerPixel , isur->pitch , ifmt->Rmask ,		ifmt->Gmask , ifmt->Bmask , ifmt->Amask);	// heres the problem	//SDL_FreeSurface(image0);	SDL_Rect dest;	// create destination rectangle	dest.x = 10;	dest.y = 100;	SDL_BlitSurface(image0 , NULL , screen , &dest);

how can i properly copy 2 SDL_Surface's?
wow! thanks so much!
If you also want the alpha channel, you're going to have to call the SDL_DisplayFormatAlpha function.
Rob Loach [Website] [Projects] [Contact]

This topic is closed to new replies.

Advertisement