SDL/include
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
..
SDL.h Fixed bug 3165 - define numbers don't match types in Swift 2016-10-01 13:35:36 -07:00
SDL_assert.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_atomic.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_audio.h audio: Implemented buffer queueing for capture devices (SDL_DequeueAudio()). 2016-08-06 02:47:27 -04:00
SDL_bits.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_blendmode.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_clipboard.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config.h.cmake Fixed bug 3301 - IBus support on Linux with CMake 2016-10-01 12:48:08 -07:00
SDL_config.h.in Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_android.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_iphoneos.h Enable SDL_LoadObject on iOS 8+ and tvOS. 2016-09-25 15:02:06 -03:00
SDL_config_macosx.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_minimal.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_pandora.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_psp.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_windows.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_winrt.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_wiz.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_copying.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_cpuinfo.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_egl.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_endian.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_error.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_events.h Added SDL_DROPBEGIN and SDL_DROPCOMPLETE events, plus window IDs for drops. 2016-01-05 01:42:00 -05:00
SDL_filesystem.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_gamecontroller.h Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
SDL_gesture.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_haptic.h Fixed bug 3165 - define numbers don't match types in Swift 2016-10-01 13:35:36 -07:00
SDL_hints.h Added brackets to function names in header comments so that doxygen links them. 2016-10-02 22:32:18 +02:00
SDL_joystick.h Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
SDL_keyboard.h Fixed two old identifiers in header comments. 2016-08-03 22:39:44 +02:00
SDL_keycode.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_loadso.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_log.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_main.h Android: Updated name of README file. 2016-04-25 22:17:38 +02:00
SDL_messagebox.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_mouse.h Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
SDL_mutex.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_name.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_opengl.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_opengl_glext.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles.h Fixed including OpenGL ES on iOS without any other SDL headers 2016-09-14 08:20:24 -07:00
SDL_opengles2.h Fixed including OpenGL ES on iOS without any other SDL headers 2016-09-14 08:20:24 -07:00
SDL_opengles2_gl2.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_gl2ext.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_gl2platform.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_khrplatform.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_pixels.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_platform.h Initial Apple TV / tvOS support. 2016-09-13 22:18:06 -03:00
SDL_power.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_quit.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_rect.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_render.h Fixed bug 3345 - SDL_RenderClear inconsistency with ClipRect 2016-10-01 11:46:32 -07:00
SDL_revision.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_rwops.h Fixed bug 3165 - define numbers don't match types in Swift 2016-10-01 13:35:36 -07:00
SDL_scancode.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_shape.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_stdinc.h Fixed bug 2885 - SDL_stdinc.h doesn't need to include iconv.h 2016-10-07 16:44:42 -07:00
SDL_surface.h Fixed bug 2924 - SDL_CreateRGBSurface[From] versions that take SDL_PIXELFORMAT enum 2016-10-07 17:04:58 -07:00
SDL_system.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_syswm.h Expose the EGL display and window for Vivante SDL windows 2016-01-16 21:58:49 -08:00
SDL_test.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_assert.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_common.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_compare.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_crc32.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_font.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_fuzzer.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_harness.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_images.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_log.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_md5.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_random.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_thread.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_timer.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_touch.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_types.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_version.h Updated version to 2.0.5 in preparation for release 2016-09-28 22:24:01 -07:00
SDL_video.h Fixed bug 3165 - define numbers don't match types in Swift 2016-10-01 13:35:36 -07:00
begin_code.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
close_code.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00