MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / SDL_CreateRGBSurfaceWithFormatFrom

Function SDL_CreateRGBSurfaceWithFormatFrom

deps/SDL2/src/video/SDL_surface.c:190–207  ·  view source on GitHub ↗

* Create an RGB surface from an existing memory buffer using the given given * enum SDL_PIXELFORMAT_* format */

Source from the content-addressed store, hash-verified

188 * enum SDL_PIXELFORMAT_* format
189 */
190SDL_Surface *
191SDL_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
209int
210SDL_SetSurfacePalette(SDL_Surface * surface, SDL_Palette * palette)

Callers 1

SDL_LockTextureToSurfaceFunction · 0.85

Calls 2

SDL_SetClipRectFunction · 0.85

Tested by

no test coverage detected