Copy SDL_Surface
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?
it seems, theres a problem. this piece of code does not copy 2 surfaces (excuse the mess)
how can i properly copy 2 SDL_Surface's?
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?
If you also want the alpha channel, you're going to have to call the SDL_DisplayFormatAlpha function.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement