android-project/gradlew.bat
author Sam Lantinga
Sun, 05 Apr 2020 08:58:47 -0700
changeset 13689 c3055b205671
parent 11647 5816b27073a4
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.
slouken@11647
     1
@if "%DEBUG%" == "" @echo off
slouken@11647
     2
@rem ##########################################################################
slouken@11647
     3
@rem
slouken@11647
     4
@rem  Gradle startup script for Windows
slouken@11647
     5
@rem
slouken@11647
     6
@rem ##########################################################################
slouken@11647
     7
slouken@11647
     8
@rem Set local scope for the variables with windows NT shell
slouken@11647
     9
if "%OS%"=="Windows_NT" setlocal
slouken@11647
    10
slouken@11647
    11
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
slouken@11647
    12
set DEFAULT_JVM_OPTS=
slouken@11647
    13
slouken@11647
    14
set DIRNAME=%~dp0
slouken@11647
    15
if "%DIRNAME%" == "" set DIRNAME=.
slouken@11647
    16
set APP_BASE_NAME=%~n0
slouken@11647
    17
set APP_HOME=%DIRNAME%
slouken@11647
    18
slouken@11647
    19
@rem Find java.exe
slouken@11647
    20
if defined JAVA_HOME goto findJavaFromJavaHome
slouken@11647
    21
slouken@11647
    22
set JAVA_EXE=java.exe
slouken@11647
    23
%JAVA_EXE% -version >NUL 2>&1
slouken@11647
    24
if "%ERRORLEVEL%" == "0" goto init
slouken@11647
    25
slouken@11647
    26
echo.
slouken@11647
    27
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
slouken@11647
    28
echo.
slouken@11647
    29
echo Please set the JAVA_HOME variable in your environment to match the
slouken@11647
    30
echo location of your Java installation.
slouken@11647
    31
slouken@11647
    32
goto fail
slouken@11647
    33
slouken@11647
    34
:findJavaFromJavaHome
slouken@11647
    35
set JAVA_HOME=%JAVA_HOME:"=%
slouken@11647
    36
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
slouken@11647
    37
slouken@11647
    38
if exist "%JAVA_EXE%" goto init
slouken@11647
    39
slouken@11647
    40
echo.
slouken@11647
    41
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
slouken@11647
    42
echo.
slouken@11647
    43
echo Please set the JAVA_HOME variable in your environment to match the
slouken@11647
    44
echo location of your Java installation.
slouken@11647
    45
slouken@11647
    46
goto fail
slouken@11647
    47
slouken@11647
    48
:init
slouken@11647
    49
@rem Get command-line arguments, handling Windowz variants
slouken@11647
    50
slouken@11647
    51
if not "%OS%" == "Windows_NT" goto win9xME_args
slouken@11647
    52
if "%@eval[2+2]" == "4" goto 4NT_args
slouken@11647
    53
slouken@11647
    54
:win9xME_args
slouken@11647
    55
@rem Slurp the command line arguments.
slouken@11647
    56
set CMD_LINE_ARGS=
slouken@11647
    57
set _SKIP=2
slouken@11647
    58
slouken@11647
    59
:win9xME_args_slurp
slouken@11647
    60
if "x%~1" == "x" goto execute
slouken@11647
    61
slouken@11647
    62
set CMD_LINE_ARGS=%*
slouken@11647
    63
goto execute
slouken@11647
    64
slouken@11647
    65
:4NT_args
slouken@11647
    66
@rem Get arguments from the 4NT Shell from JP Software
slouken@11647
    67
set CMD_LINE_ARGS=%$
slouken@11647
    68
slouken@11647
    69
:execute
slouken@11647
    70
@rem Setup the command line
slouken@11647
    71
slouken@11647
    72
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
slouken@11647
    73
slouken@11647
    74
@rem Execute Gradle
slouken@11647
    75
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
slouken@11647
    76
slouken@11647
    77
:end
slouken@11647
    78
@rem End local scope for the variables with windows NT shell
slouken@11647
    79
if "%ERRORLEVEL%"=="0" goto mainEnd
slouken@11647
    80
slouken@11647
    81
:fail
slouken@11647
    82
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
slouken@11647
    83
rem the _cmd.exe /c_ return code!
slouken@11647
    84
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
slouken@11647
    85
exit /b 1
slouken@11647
    86
slouken@11647
    87
:mainEnd
slouken@11647
    88
if "%OS%"=="Windows_NT" endlocal
slouken@11647
    89
slouken@11647
    90
:omega