Sylvain
988714beb9
Fixed bug #14173 - Android / SDL_Renderer Vulkan : going background / foreground produces a black screen.
...
need to recreate the swap chain + send SDL_EVENT_RENDER_DEVICE_RESET event
(cherry picked from commit 2a96997e90 )
2025-10-09 08:41:00 -07:00
Sam Lantinga
2be2fb4918
Fixed build
2025-10-04 10:28:57 -04:00
Sam Lantinga
2a3a8f736c
Fixed destination coordinates when using scale with the software renderer
...
Fixes https://github.com/libsdl-org/SDL/issues/14051
(cherry picked from commit d333044462 )
2025-10-03 13:58:57 -07:00
Jaan Soulier
35408a2126
Fix reallocation of GPU renderer vertex buffer
...
(cherry picked from commit ed6a72a7fd )
2025-09-09 20:28:32 -07:00
Sam Lantinga
e5b9dfd181
Fixed setting SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER
...
(cherry picked from commit b7dba970e1 )
2025-09-09 17:35:03 -07:00
Sam Lantinga
ad2b211f75
Fixed pitch and chroma issues with the Vulkan planar YUV texture update functions
...
Fixes https://github.com/libsdl-org/SDL/issues/13734
(cherry picked from commit 466f93aee1 )
2025-09-07 10:19:59 -07:00
Sam Lantinga
5594d03da0
Leave letterbox borders set to the frame clear color
...
Fixes https://github.com/libsdl-org/sdl2-compat/issues/483
(cherry picked from commit fbbc29159a )
2025-09-02 20:14:56 -07:00
Sam Lantinga
f2ae66b64f
Set the texture scale and address mode when creating a texture
...
Fixes https://github.com/libsdl-org/sdl2-compat/issues/506
(cherry picked from commit ef19c72015 )
2025-09-02 19:46:28 -07:00
Petar Popovic
0d1d4ea1f9
SDL_SetRenderDrawBlendMode(): Remove redundant param check
...
(cherry picked from commit b63c32e790 )
2025-08-08 14:06:27 -04:00
Petar Popovic
e3f47809c4
Fix potential memory leak in SDL_render_gles2.c
...
(cherry picked from commit 09221820f6 )
2025-07-31 16:19:10 -07:00
Sam Lantinga
608101a185
Update the viewport when logical presentation changes
...
Fixes https://github.com/libsdl-org/SDL/issues/13256
(cherry picked from commit 727b4924c8 )
2025-06-25 09:59:13 -07:00
Sam Lantinga
0aaa0321cc
Fixed warning C5286: implicit conversion from enum type 'VkFilter' to enum type 'SDL_ScaleMode'
2025-06-21 07:41:20 -07:00
Francisco Javier Trujillo Mata
c925f72562
Fix wrong callback type
...
(cherry picked from commit c89357bf60 )
2025-05-20 11:11:01 -07:00
Frank Praznik
8d604353a5
renderer: Always use the output size when updating the main view
...
The main view always reflects the size of the output, so don't use the dimensions of the currently bound render target texture when updating it, or it will reflect an incorrect size when the render target texture is unbound.
(cherry picked from commit 8aa5b97bb5 )
2025-05-14 09:38:13 -07:00
Sam Lantinga
0897f4a7d1
Backported Metal sampler improvements from main
...
Fixes https://github.com/libsdl-org/SDL/issues/12988
2025-05-08 10:22:17 -07:00
Petar Popovic
0834f1d6ce
SDL_GetRectIntersectionFloat(): Allow rendering zero-sized srcrect
...
(cherry picked from commit 27b256022b )
2025-04-23 16:16:24 -07:00
Sam Lantinga
cb0ba020d4
Don't reset the render target when invalidating GPU renderer cache state
...
Fixes https://github.com/libsdl-org/SDL/issues/12646
(cherry picked from commit f35a2736b7 )
2025-04-11 09:24:38 -07:00
Sam Lantinga
02036ee643
Fixed texture colorspace when creating a texture from a surface
...
Fixes https://github.com/libsdl-org/SDL/issues/12691
(cherry picked from commit 36fc1c2c9c )
2025-03-31 18:50:45 -07:00
Carl Åstholm
996466e855
Check if GL_OES_EGL_image_external is supported before trying to use it
...
(cherry picked from commit dd9b9d4513 )
2025-03-24 19:52:54 -07:00
Sam Lantinga
f971a59746
Fixed DebugLogRenderCommands() output
...
(cherry picked from commit 758eb256b9 )
2025-03-20 21:25:23 -07:00
Sam Lantinga
5836266bfb
We need to rebind D3D12 resources after updating them
...
Fixes https://github.com/libsdl-org/SDL/issues/12544
(cherry picked from commit 4ceb02434b )
2025-03-20 20:22:33 -07:00
Sam Lantinga
d0122ff624
Make sure we're getting called for the correct window
...
Fixes https://github.com/libsdl-org/SDL/issues/12525
(cherry picked from commit 47b0c75470 )
2025-03-19 20:22:52 -07:00
Carl Åstholm
0ac030549b
emscripten: Fix undefined behavior in opengles2 renderer
...
(cherry picked from commit 14deef997c )
2025-03-18 19:19:01 -07:00
Sam Lantinga
3225d31679
Fixed building with SDL_LEAN_AND_MEAN
...
Fixes https://github.com/libsdl-org/SDL/issues/12578
(cherry picked from commit 82335fd0e9 )
2025-03-18 09:55:46 -07:00
Sam Lantinga
fec3e2cd45
Removed logic forcing vsync on if setting it off fails
...
The platforms that needed this (Windows Phone and Windows RT) are no longer supported, and if this is needed in the future it should be done at the renderer level, not here.
Fixes https://github.com/libsdl-org/SDL/issues/12475
(cherry picked from commit b99ff00a95 )
2025-03-06 16:18:42 -08:00
Sam Lantinga
b32cd4f84b
Make texture scale mode a part of the 2D renderer draw state
...
Also added texture addressing mode support to the PSP and Vita renderers (untested)
Fixes https://github.com/libsdl-org/SDL/issues/12461
(cherry picked from commit cb099ebd4f )
2025-03-05 22:39:31 -08:00
Sam Lantinga
d959719a3d
Fixed clip rect when logical presentation is enabled
...
We don't need to include the logical offset, it's already included in the viewport.
Fixes https://github.com/libsdl-org/SDL/issues/12454
(cherry picked from commit 4bb46e93c8 )
2025-03-04 08:25:46 -08:00
Sam Lantinga
b836ad4d4f
Fix a root signature mismatch for the D3D12 renderer
...
The shaders hadn't been rebuilt after c74f273848
Fixes https://github.com/libsdl-org/SDL/issues/12276
2025-03-01 12:02:49 -08:00
Ryan C. Gordon
35e8cf8ee6
render: allow render targets to use logical presentation.
...
Fixes https://github.com/libsdl-org/sdl2-compat/issues/279
2025-02-27 19:41:11 -05:00
Sam Lantinga
85a302550d
Set an error message if the rect passed to SDL_RenderReadPixels() is entirely outside the viewport
2025-02-25 10:28:57 -08:00
Sam Lantinga
db4e6c1931
Cocoa metal layers need their size updated before renderer updates
...
Also refactored event watch code so it can be shared between internal window event dispatch and public event watchers.
Fixes https://github.com/libsdl-org/SDL/issues/12376
2025-02-24 15:37:13 -08:00
Petar Popovic
c70f54e28b
Remove redundant casts
2025-02-21 10:09:10 -08:00
Sam Lantinga
2e89c53ebc
Added support for decoding MJPG into NV12 textures
2025-02-20 12:16:26 -08:00
Sam Lantinga
a792434a37
Added initial MJPG support using stb_image
2025-02-20 12:16:26 -08:00
Sam Lantinga
1a38960eee
Call SDL_DiscardAllCommands() for the software renderer as well
2025-02-20 09:53:11 -08:00
Sam Lantinga
8f4c5e15f1
Finish any drawing when destroying a software renderer
...
Fixes the SDL3 version of https://github.com/libsdl-org/sdl2-compat/issues/373
2025-02-20 08:49:47 -08:00
nightmareci
7500a758b8
Remove usages of restrict keyword in SDL_render.c
...
I ran into the usage of `restrict` breaking builds targeting Windows XP, as the v141 MSVC toolset doesn't support the keyword.
2025-02-18 11:40:43 -08:00
Ryan C. Gordon
84a236c92e
hashtable: Redesign the hashtable API.
...
This was intended to make the API public, so SDL_hashtable.h got an extreme
documentation makeover, but for now this remains a private header.
This makes several significant interface changes to SDL_HashTable, and
improves code that makes use of it in various ways.
- The ability to make "stackable" tables is removed. Apparently this still
worked with the current implementation, but I could see a future
implementation struggle mightily to support this. It'll be better for
something external to build on top of the table if it needs it, inserting a
linked list of stacked items as the hash values and managing them separately.
There was only one place in SDL using this, unnecessarily, and that has also
been cleaned up to not need it.
- You no longer specify "buckets" when creating a table, but rather an
estimated number of items the table is meant to hold. The bucket count was
crucial to our classic hashtable implementation, but meant less once we
moved to an Open Addressing implementation anyhow, since the bucket count
isn't static (and they aren't really "buckets" anymore either). Now you
can just report how many items you think the hash will hold and SDL will
allocate a reasonable default for you...or 0 to not guess, and SDL will
start small and grow as necessary, which is often the correct thing to do.
- There's no more SDL_IterateHashTableKey because there's no more "stackable"
hash tables.
- SDL_IterateHashTable() now uses a callback, which matches other parts of SDL,
and also lets us hold the read-lock for the entire iteration and get rid of
the goofy iterator state variable.
- SDL_InsertIntoHashTable() now lets you specify whether to replace existing
keys or fail if the key already exists.
- Callbacks now use SDL conventions (userdata as the first param).
- Other naming convention fixes.
I discovered we use a lot of hash tables in SDL3 internally. :) So the bulk
of this work is fixing up that code to use the new interfaces, and simplifying
things (like checking for an item to remove it if it already exists before
inserting a replacement...just do the insert atomically, it'll do all that
for you!).
2025-02-15 18:52:56 -05:00
Sam Lantinga
fd4e6d2949
Don't render 0 sized texture rectangles
...
Fixes https://github.com/libsdl-org/sdl2-compat/issues/355
2025-02-15 07:07:56 -08:00
Petar Popovic
c16b7bcb7a
SDL_Get*Driver() functions: Set error message on failure
2025-02-13 16:10:37 -08:00
Sam Lantinga
0bce19cf15
The 10-bit texture formats have alpha on Direct3D
...
A similar change was made for Vulkan in a036aeda3b
2025-02-10 19:45:02 -08:00
Sam Lantinga
3cfa476d3f
Added support for SDL_PIXELFORMAT_ABGR8888 textures
...
This is the output format of stb_image for image decoding, so let's avoid a texture format conversion where possible.
Also standardized SDL_PIXELFORMAT_ARGB8888 as the default texture format for all renderers.
2025-02-10 19:45:02 -08:00
Sam Lantinga
cf41ccc6ce
Removed stb_image.h from SDL
...
This adds quite a bit of code size to SDL for a niche use-case. This is easily handled in the application instead.
2025-02-10 17:18:16 -08:00
Sam Lantinga
84b0c13c44
Added support for Motion JPEG camera capture
...
Fixes https://github.com/libsdl-org/SDL/issues/12183
2025-02-10 17:18:16 -08:00
danginsburg
4fd0b2a85c
Fix #12142 - the problem was if the size of the vertex buffer was exceeded, the currentVertexBuffer would be reset to zero and thus we'd leave it pointing to an in-use VB that would get overwritten on the next present before the vkQueueSubmit occurred.
2025-02-10 08:47:57 -08:00
Sam Lantinga
48c00bfe6c
Fixed creating a window with both software and hardware renderer attached
2025-02-06 15:35:38 -08:00
Sam Lantinga
ad8429f1b0
Let the renderer always see window events
...
These are necessary for proper operation of the renderer and shouldn't be blocked by event filters, etc.
2025-02-06 14:38:20 -08:00
Sam Lantinga
8e51b2468a
Renamed SDL_SoftStretch() to SDL_StretchSurface()
...
Fixes https://github.com/libsdl-org/SDL/issues/12168
2025-02-03 08:51:32 -08:00
Em
c922762791
proposed fix: set curr_src.h is to bottom_height before drawing bottom edges / corners in SDL_RenderTexture9Grid, to avoid issue where inadvertently using top height if the npatch existed on a larger texture than the drawn edge would cause too many pixels to be included in the bottom part of the render.
2025-02-01 16:09:08 -08:00
Petar Popovic
a336b62d8b
Remove newlines from error messages
2025-01-23 11:45:04 -08:00