SDL/src
Sam Lantinga d2676c2985 Fixed bug 2924 - SDL_CreateRGBSurface[From] versions that take SDL_PIXELFORMAT enum
Daniel Gibson

Currently, SDL_CreateRGBSurface() and SDL_CreateRGBSurfaceFrom() take Uint32 masks for RGBA to "describe" the Pixelformat of the surface.
Internally those value are only used to map to one of the SDL_PIXELFORMAT_* enum values that are used for further processing.

I think it would be both handy and more efficient to be able to specify SDL_PIXELFORMAT_* yourself without using SDL_PixelFormatEnumToMasks() to create masks first, so I implemented functions that do that:
SDL_CreateRGBSurfaceWithFormat() and SDL_CreateRGBSurfaceWithFormatFrom() which are like the versions without "WithFormat" but instead of taking 4 Uint32s for R/G/B/A masks, they take one for a SDL_PIXELFORMAT_* enum value.

Together with https://bugzilla.libsdl.org/show_bug.cgi?id=2923 creating a SDL_Surface* from RGBA data (e.g. from stb_image)  is as easy as
  surf = SDL_SDL_CreateRGBSurfaceWithFormat(0, w, h, bppToUse*8, SDL_PIXELFORMAT_RGBA32);
2016-10-07 17:04:58 -07:00
..
atomic Updated copyright to 2016 2016-01-02 10:10:34 -08:00
audio audio: Backed out the audio-thread detaching changes. 2016-10-07 19:39:43 -04:00
core Fixed compiler warning about missing field initializers 2016-10-04 03:42:42 -07:00
cpuinfo Updated copyright to 2016 2016-01-02 10:10:34 -08:00
dynapi Fixed bug 2924 - SDL_CreateRGBSurface[From] versions that take SDL_PIXELFORMAT enum 2016-10-07 17:04:58 -07:00
events Fixed bug 3161 - SDL_WINDOWEVENT_EXPOSED event possible queue overflow 2016-10-01 13:38:30 -07:00
file Updated copyright to 2016 2016-01-02 10:10:34 -08:00
filesystem Fixed compiling if filesystem is disabled (thanks, Elias!). 2016-08-30 21:14:13 +02:00
haptic Fixed bug 3021 - HapticOpenFromJoystick() problems 2016-10-04 03:50:28 -07:00
joystick Fixed bug 2833 - Access Violation on SDL_PollEvent after init, delay and quit of joystick subsystem 2016-10-07 16:32:58 -07:00
libm Updated copyright to 2016 2016-01-02 10:10:34 -08:00
loadso Enable SDL_LoadObject on iOS 8+ and tvOS. 2016-09-25 15:02:06 -03:00
main Fixed bug 3320 - SDL_windows_main.c defines both console application entry points 2016-10-01 12:31:31 -07:00
power Initial Apple TV / tvOS support. 2016-09-13 22:18:06 -03:00
render Fixed wrong pixel format if reading pixels from OpenGL renderer. 2016-10-02 22:32:35 +02:00
stdlib Fixed bug 2885 - SDL_stdinc.h doesn't need to include iconv.h 2016-10-07 16:44:42 -07:00
test We should be using a string constant for the strftime format string 2016-10-01 10:38:15 -07:00
thread Fixed bug 3388 - Fail to build src/thread/windows/SDL_systhread.c on MinGW 4.9.3 2016-10-01 10:08:34 -07:00
timer threads: Move SDL's own thread creation to a new internal API. 2016-04-12 16:45:10 -04:00
video Fixed bug 2924 - SDL_CreateRGBSurface[From] versions that take SDL_PIXELFORMAT enum 2016-10-07 17:04:58 -07:00
SDL.c Initial Apple TV / tvOS support. 2016-09-13 22:18:06 -03:00
SDL_assert.c Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_assert_c.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_error.c Only use GCC pragmas when we're building with GCC 2016-10-01 11:22:39 -07:00
SDL_error_c.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_hints.c Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_internal.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_log.c Fixed bug 3323 - SDL_LogOutput prints message twice on Windows when linked with libc 2016-10-01 12:28:05 -07:00