mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-26 07:48:42 +00:00
* Rename SDL_CreateRGBSurface{,From} to SDL_CreateSurface{,From}, which now takes a format parameter
This commit is contained in:
parent
778b8926b4
commit
932f61348d
36 changed files with 212 additions and 558 deletions
|
|
@ -173,13 +173,9 @@ loadFont(void)
|
|||
SDL_SetColorKey(surface, 1, SDL_MapRGB(surface->format, 238, 0, 252));
|
||||
/* now we convert the surface to our desired pixel format */
|
||||
int format = SDL_PIXELFORMAT_ABGR8888; /* desired texture format */
|
||||
Uint32 Rmask, Gmask, Bmask, Amask; /* masks for desired format */
|
||||
int bpp; /* bits per pixel for desired format */
|
||||
SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask,
|
||||
&Amask);
|
||||
SDL_Surface *converted =
|
||||
SDL_CreateRGBSurface(surface->w, surface->h, bpp, Rmask, Gmask,
|
||||
Bmask, Amask);
|
||||
|
||||
SDL_Surface *converted = SDL_CreateSurface(surface->w, surface->h, format);
|
||||
|
||||
SDL_BlitSurface(surface, NULL, converted, NULL);
|
||||
/* create our texture */
|
||||
texture = SDL_CreateTextureFromSurface(renderer, converted);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue