docs/README-porting.md
author Sam Lantinga
Sun, 05 Apr 2020 08:58:47 -0700
changeset 13689 c3055b205671
parent 12674 e2d1f4e9c323
permissions -rw-r--r--
Fixed bug 5015 - SDL_RenderReadPixels on DirectX 11.1 backend seems to be broken

Konrad

It appears that I cannot use SDL_RenderReadPixels on a bound framebuffer (SDL_Texture set as render target) as it simply results in gibberish data. However, drawing that framebuffer into the default target (window surface) does render it correctly. Other backends (OpenGL, software, Direct3D) do work fine.

It looks to me like D3D11_RenderReadPixels just gets the general backbuffer and not the current render target and its backbuffer.

Here is the patch which actually fetches the current render target and its underlying ID3D11Resource which is ID3D11Texture2D.
     1 Porting
     2 =======
     3 
     4 * Porting To A New Platform
     5 
     6   The first thing you have to do when porting to a new platform, is look at
     7 include/SDL_platform.h and create an entry there for your operating system.
     8 The standard format is "__PLATFORM__", where PLATFORM is the name of the OS.
     9 Ideally SDL_platform.h will be able to auto-detect the system it's building
    10 on based on C preprocessor symbols.
    11 
    12 There are two basic ways of building SDL at the moment:
    13 
    14 1. The "UNIX" way:  ./configure; make; make install
    15 
    16    If you have a GNUish system, then you might try this.  Edit configure.ac,
    17    take a look at the large section labelled:
    18 
    19 	"Set up the configuration based on the host platform!"
    20 
    21    Add a section for your platform, and then re-run autogen.sh and build!
    22 
    23 2. Using an IDE:
    24 
    25    If you're using an IDE or other non-configure build system, you'll probably
    26    want to create a custom SDL_config.h for your platform.  Edit SDL_config.h,
    27    add a section for your platform, and create a custom SDL_config_{platform}.h,
    28    based on SDL_config_minimal.h and SDL_config.h.in
    29 
    30    Add the top level include directory to the header search path, and then add
    31    the following sources to the project:
    32 
    33 	src/*.c
    34 	src/atomic/*.c
    35 	src/audio/*.c
    36 	src/cpuinfo/*.c
    37 	src/events/*.c
    38 	src/file/*.c
    39 	src/haptic/*.c
    40 	src/joystick/*.c
    41 	src/power/*.c
    42 	src/render/*.c
    43 	src/render/software/*.c
    44 	src/stdlib/*.c
    45 	src/thread/*.c
    46 	src/timer/*.c
    47 	src/video/*.c
    48 	src/audio/disk/*.c
    49 	src/audio/dummy/*.c
    50 	src/filesystem/dummy/*.c
    51 	src/video/dummy/*.c
    52 	src/haptic/dummy/*.c
    53 	src/joystick/dummy/*.c
    54 	src/main/dummy/*.c
    55 	src/thread/generic/*.c
    56 	src/timer/dummy/*.c
    57 	src/loadso/dummy/*.c
    58 
    59 
    60 Once you have a working library without any drivers, you can go back to each
    61 of the major subsystems and start implementing drivers for your platform.
    62 
    63 If you have any questions, don't hesitate to ask on the SDL mailing list:
    64 	http://www.libsdl.org/mailing-list.php
    65 
    66 Enjoy!
    67 	Sam Lantinga				(slouken@libsdl.org)
    68