* Create an RGB surface from an existing memory buffer using the given given * enum SDL_PIXELFORMAT_* format */
| 188 | * enum SDL_PIXELFORMAT_* format |
| 189 | */ |
| 190 | SDL_Surface * |
| 191 | SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, |
| 192 | int width, int height, int depth, int pitch, |
| 193 | Uint32 format) |
| 194 | { |
| 195 | SDL_Surface *surface; |
| 196 | |
| 197 | surface = SDL_CreateRGBSurfaceWithFormat(0, 0, 0, depth, format); |
| 198 | if (surface != NULL) { |
| 199 | surface->flags |= SDL_PREALLOC; |
| 200 | surface->pixels = pixels; |
| 201 | surface->w = width; |
| 202 | surface->h = height; |
| 203 | surface->pitch = pitch; |
| 204 | SDL_SetClipRect(surface, NULL); |
| 205 | } |
| 206 | return surface; |
| 207 | } |
| 208 | |
| 209 | int |
| 210 | SDL_SetSurfacePalette(SDL_Surface * surface, SDL_Palette * palette) |
no test coverage detected