Sam Lantinga
e97b2061b4
Converted shader headers to UNIX line endings
2024-02-05 11:47:17 -08:00
Sam Lantinga
e98e5abd2a
Added batch file to create D3D12 shaders
2024-02-05 11:47:17 -08:00
Sam Lantinga
9755e490c0
Workaround for crash at shutdown in testffmpeg
...
I'm not sure if this is something in SDL crashing or something in ffmpeg, but it's safer to leave the D3D DLLs loaded.
2024-02-05 09:45:39 -08:00
Sam Lantinga
e74171b1ae
Added support for HDR10 video playback on direct3d11
...
Fixes https://github.com/libsdl-org/SDL/issues/8053
2024-02-05 09:45:39 -08:00
Sam Lantinga
548b382fd9
Fixed slow startup time when using the direct3d12 renderer
...
On some systems creating the entire set of available pipeline states is very time consuming. We'll only use a few of them in any given program, so we'll just create them on demand.
Fixes https://github.com/libsdl-org/SDL/issues/7634
2024-02-04 13:09:40 -08:00
Sam Lantinga
dab77fe29b
Added support for SDL_COLORSPACE_BT709_FULL to the hardware renderers
2024-02-04 13:09:40 -08:00
Sam Lantinga
2ad4646a24
Don't release currentOffscreenRenderTargetView, we don't have a reference to it
2024-02-03 12:49:53 -08:00
Sam Lantinga
9005512c18
Fixed build
2024-02-03 12:39:52 -08:00
Sam Lantinga
7271a2040b
Don't force on the D3D11 debug flag
2024-02-03 12:39:11 -08:00
Sam Lantinga
b4d0af9cf3
Removed unused variables
2024-02-03 12:39:11 -08:00
Sam Lantinga
89b9d6cbdc
SDL_RenderReadPixels() now returns a surface
...
Fixes https://github.com/libsdl-org/SDL/issues/8977
2024-02-03 11:49:15 -08:00
Sam Lantinga
50a805cdd1
Use YUV colorspaces instead of a global YUV conversion mode
...
Fixes https://github.com/libsdl-org/SDL/issues/8669
2024-02-03 07:36:18 -08:00
Sam Lantinga
aa8f609ff3
Clamp HDR colors to the SDR range for SDR renderers
2024-02-02 13:13:53 -08:00
Sam Lantinga
9591b2cfb4
Finalized the SDL render API colorspaces
...
The renderer will always use the sRGB colorspace for drawing, and will default to the sRGB output colorspace. If you want blending in linear space and HDR support, you can select the scRGB output colorspace, which is supported by the direct3d11 and direct3d12
2024-02-02 13:13:53 -08:00
Sam Lantinga
dc607c666b
Fixed creating HDR textures with SDL_CreateTexture()
2024-02-01 15:36:49 -08:00
Sam Lantinga
7561116873
Added support for floating point texture formats
2024-02-01 12:17:35 -08:00
Sam Lantinga
90597aeaef
HDR10 colorspace isn't currently supported
...
You can't do blending directly in PQ space, which means you have to create a scene render target in linear space and use shaders to convert PQ texture data to linear, etc. All of this is out of scope for the SDL 2D renderer at the moment.
2024-02-01 12:17:35 -08:00
Sam Lantinga
fc35b7e121
Convert to sRGB if trying to create a texture from an HDR surface
2024-02-01 12:17:35 -08:00
Sam Lantinga
dd28ab0489
Added SDL_SetRenderDrawColorspace() and SDL_GetRenderDrawColorspace()
2024-02-01 12:17:35 -08:00
Sam Lantinga
9c8b47b726
Cache the draw color state in the software and PSP renderers
...
Converting the color from float is a bit expensive, so let's cache that state
2024-02-01 12:17:35 -08:00
Sam Lantinga
dacfaa91b4
Make sure to round color values when converting to Uint8
2024-02-01 12:17:35 -08:00
Sam Lantinga
6f443e2aca
Added support for the scRGB colorspace on D3D11 and D3D12
2024-01-31 18:07:00 -08:00
Sam Lantinga
12c31898c1
Update colors in SDL_RenderGeometryRaw() if we're doing interpolation in linear space
...
Testing: Modified testgeometry to clear the background to 0.5 and then changed the triangle color to 0.5, and verified that they were the same color when using the D3D11 renderer.
2024-01-31 11:02:45 -08:00
Sam Lantinga
77549dc91e
Fixed some places using SDL_SetRenderDrawColor() instead of SDL_SetRenderDrawColorFloat()
2024-01-31 11:02:45 -08:00
Sam Lantinga
49cc4c14e9
Use the default colorspace if we have to convert texture pixels
2024-01-31 09:50:46 -08:00
Sam Lantinga
f257eb4481
Added the concept of colorspace to the SDL renderer
...
This allows color operations to happen in linear space between sRGB input and sRGB output. This is currently supported on the direct3d11, direct3d12 and opengl renderers.
This is a good resource on blending in linear space vs sRGB space:
https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/
Also added testcolorspace to verify colorspace changes
2024-01-30 09:48:02 -08:00
Sam Lantinga
554f0625d3
Renderer colors now have floating point precision
2024-01-30 09:48:02 -08:00
Francisco Javier Trujillo Mata
da8fc70a83
Fixing viewport
2024-01-29 20:41:25 -08:00
Francisco Javier Trujillo Mata
851c1a5e9c
Fix scissor usage
2024-01-29 20:41:25 -08:00
Francisco Javier Trujillo Mata
dc35ee9d54
Fix color
2024-01-29 20:41:25 -08:00
Sam Lantinga
3b55c7d1f4
Shortened SDL property names
2024-01-27 13:00:50 -08:00
Ozkan Sezer
81314c4998
SDL_render_gl.c: adjust for new SDL_PLATFORM_WINDOWS meaning.
2024-01-24 21:20:50 +03:00
Anonymous Maarten
31d133db40
Define SDL_PLATFORM_* macros instead of underscored ones ( #8875 )
2024-01-24 01:40:51 +00:00
Sam Lantinga
308906ba25
Added SDL_FlipSurface() to flip a surface vertically or horizontally
...
Fixes https://github.com/libsdl-org/SDL/issues/8857
2024-01-20 06:31:37 -08:00
Sam Lantinga
6a00ae7e58
Fixed rendering diagonal lines within a viewport
...
The drawing uses the origin of the viewport as the coordinate origin, so we only need to clip against the size of the viewport.
Also added a unit test to catch this case in the future
2024-01-19 16:29:38 -08:00
Sam Lantinga
a73132177d
Make sure the render target isn't bound as a resource
...
Fixes https://github.com/libsdl-org/SDL/issues/3380
2024-01-19 15:17:30 -08:00
Sam Lantinga
bd5d4d61ed
Fixed potential overflow in software triangle rendering
2024-01-19 08:31:56 -08:00
Sam Lantinga
9fc1135e3b
Fixed warning C4127: conditional expression is constant
2024-01-19 06:44:32 -08:00
Sam Lantinga
518b070aa9
Fixed drop event coordinate conversion
2024-01-16 14:07:42 -08:00
Sam Lantinga
be0ba78c56
Convert the coordinates in drop events as well (thanks @Dragon-Baroque!)
2024-01-16 12:00:36 -08:00
Sylvain
ce0e0675de
Fixed bug #8301 - Software renderer draws long lines incorrectly / SDL_RENDERLINEMETHOD_GEOMETRY
2024-01-16 07:06:29 -08:00
chalonverse
3a4ac15a27
Make Xbox GDK code public (and fix some GDK code rot) ( #8844 )
2024-01-14 20:31:41 -08:00
Sylvain
4033a0a83b
Prevent ASAN warning:
...
like SDL_triangle.c:305:30: runtime error: left shift of negative value -672
(even if the value was correctly computed)
2024-01-12 11:53:34 -08:00
Ryan C. Gordon
82f2c4d581
render: Renamed SDL_GetTextureRenderer to SDL_GetRendererFromTexture.
2024-01-08 14:16:16 -05:00
Ryan C. Gordon
df438a3170
opengl: OpenGL renderers need to support texture target in properties.
...
Otherwise this has to become an awkward heuristic in sdl2-compat.
2024-01-08 14:08:35 -05:00
Ryan C. Gordon
9bc7cfc755
render: Added SDL_GetTextureRenderer().
2024-01-08 10:17:38 -05:00
Sam Lantinga
7eae08cfc4
Removed SDL_GL_BindTexture() and SDL_GL_UnbindTexture()
...
Now that we have the OpenGL texture properties, you can directly bind them yourself.
Fixes https://github.com/libsdl-org/SDL/issues/2124
2024-01-07 20:19:19 -08:00
Sam Lantinga
1a13dae219
Added constant definitions for SDL properties
...
Fixes https://github.com/libsdl-org/SDL/issues/8622
2024-01-07 16:59:41 -08:00
Sam Lantinga
5b3ee51c6c
Updated copyright for 2024
2024-01-01 13:15:26 -08:00
Sylvain
ffd82fb7c4
Add scaleMode to SDL_SoftStretch(), remove SDL_SoftStretchLinear().
2023-12-22 09:13:21 -08:00