Simple Directmedia Layer
Go to file
Sam Lantinga 41c718db85 Fixed bug 4469 - make SDL_CreateTextureFromSurface pick a more appropriate format
Sylvain

Currently SDL_CreateTextureFromSurface picks first valid format, and do a conversion.

    format = renderer->info.texture_formats[0];
    for (i = 0; i < renderer->info.num_texture_formats; ++i) {
        if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) &&
            SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == needAlpha) {
            format = renderer->info.texture_formats[i];
            break;

It could try to find a better format, for instance :

 if SDL_Surface has no Amask, but a colorkey :
   if surface fmt is RGB888, try to pick ARGB8888 renderer fmt
   if surface fmt is BGR888, try to pick ABGR8888 renderer fmt
 else
   try to pick the same renderer format as surface fmt

if no format has been picked, use the fallback.


I think it goes with bug 4290 fastpath BlitNtoN
when you expand a surface with pixel format of size 24 to 32, there is a fast path possible.


So with this issue:

- if you have a surface with colorkey (RGB or BGR, not palette), it takes a renderer format where the conversion is faster.
  (it avoids, if possible, RGB -> ABGR which means switching RGB to BGR)

- if you have a surface ABGR format, it try to take the ABGR from the renderer.
  (it avoids, if possible, ABGR -> ARGB, which means switch RGB to BGR)
2019-05-19 12:04:06 -07:00
acinclude Added missing PKG_CONFIG macros 2019-03-16 17:39:15 -07:00
android-project Fixed bug 4566 - Hot-plugging Bluetooth controller causes force-quit on Android 2019-04-24 12:53:15 -07:00
android-project-ant
build-scripts
cmake
debian
docs Android: add hint SDL_HINT_ANDROID_BLOCK_ON_PAUSE 2019-04-05 09:16:30 +02:00
include test: added SDLTest_CommonDefaultArgs() 2019-05-19 01:45:15 -04:00
src Fixed bug 4469 - make SDL_CreateTextureFromSurface pick a more appropriate format 2019-05-19 12:04:06 -07:00
test test: added SDLTest_CommonDefaultArgs() 2019-05-19 01:45:15 -04:00
VisualC Fixed Visual Studio build 2019-03-16 19:46:37 -07:00
VisualC-WinRT
visualtest
wayland-protocols
Xcode Added support for building SDL as a dynamic library on iOS 2019-03-19 07:53:33 -07:00
Xcode-iOS Created Xcode schemes for building on iOS and tvOS 2019-04-23 14:08:09 -07:00
.hgignore
Android.mk
autogen.sh
BUGS.txt
cmake_uninstall.cmake.in
CMakeLists.txt Use _Exit() when available 2019-04-23 07:59:31 -07:00
configure Use _Exit() when available 2019-04-23 07:59:31 -07:00
configure.ac Use _Exit() when available 2019-04-23 07:59:31 -07:00
COPYING.txt
CREDITS.txt
INSTALL.txt
Makefile.in Add a configure option allowing users to choose whether to install sdl2-config 2019-04-07 23:01:07 +10:00
Makefile.minimal
Makefile.os2
Makefile.pandora
Makefile.psp
Makefile.wiz
README-SDL.txt
README.txt
sdl2-config.cmake.in
sdl2-config.in
sdl2.m4 Fixed bug 4544 - SDL2.m4 SDL2.framework patch made it impossible to fail detection 2019-03-16 18:45:10 -07:00
sdl2.pc.in
SDL2.spec.in
SDL2Config.cmake
TODO.txt
VisualC.html
WhatsNew.txt Android: add hint SDL_HINT_ANDROID_BLOCK_ON_PAUSE 2019-04-05 09:16:30 +02:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting
with README.md

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)