Commit Graph

712 Commits

Author SHA1 Message Date
Sam Lantinga
b299cb3d3c Added a utility function to calculate the next power of 2 for a value 2022-07-17 08:31:16 -07:00
chalonverse
f317d619cc
Xbox GDKX support (#5869)
* Xbox GDK support (14 squashed commits)

* Added basic keyboard testing

* Update readme

* Code review fixes

* Fixed issue where controller add/removal wasn't working (since the device notification events don't work on Xbox, have to use the joystick thread to poll XInput)
2022-07-01 13:59:14 -07:00
chalonverse
4f73219794 Fixed D3D12 renderer not working with batching, and got rid of the vertex buffer size limit 2022-06-30 03:41:17 -07:00
Pierre Wendling
6c536afdb7 Fix C89 declaration for macOS modules.
Since Clang 14, `-Wdeclaration-after-statement` is enforced on every
standard.
2022-06-27 15:19:40 -07:00
chalonverse
3b191580c3
Windows GDK Support (#5830)
* Added GDK

* Simplfied checks in SDL_config_wingdk.h

* Added testgdk sample

* Added GDK readme

* Fixed error in merge of SDL_windows.h

* Additional GDK fixes

* OpenWatcom should not export _SDL_GDKGetTaskQueue

* Formatting fixes

* Moved initialization code into SDL_GDKRunApp
2022-06-27 10:19:39 -07:00
Sylvain
314bb5a1ed
Fixed bug #5850: Android EGL_BAD_ACCESS because of viewport command while turning the screen off/on. 2022-06-27 14:45:14 +02:00
Ivan Epifanov
b2f07d94d2 Vita: create rendertarget color surface with same format as texture. Fixes #5844 2022-06-26 15:41:14 -07:00
unknown
ebe4f47f2b Fixed __VA_ARGS__ in gcc when no args 2022-06-26 15:35:18 -07:00
unknown
51c6488f97 Add support for SDL_render_d3d12.c to compile in C++ mode 2022-06-26 15:35:18 -07:00
Sam Lantinga
adc6875870 Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!)
Closes https://github.com/libsdl-org/SDL/pull/5811
2022-06-17 10:22:28 -07:00
Sam Lantinga
1eb247fa2e Fixed building D3D12 renderer with latest mingw-64 2022-06-16 15:44:18 -07:00
Ozkan Sezer
960b86dcb5 update SDL_render_d3d12.c after DPI scaling/highdpi support patch.
See https://github.com/libsdl-org/SDL/pull/5778#issuecomment-1153006938
2022-06-14 21:03:31 -07:00
Ryan C. Gordon
ded6c22efb
render: Corrected wrong SDL_memcpy() sizes for viewport, cliprect.
Fixes #5786.
2022-06-14 14:10:14 -04:00
Eric Wasylishen
e09551bc80 Fix WinRT build 2022-06-11 14:19:01 -07:00
Eric Wasylishen
ab81a559f4 Windows DPI scaling/highdpi support
Adds hint "SDL_WINDOWS_DPI_SCALING" which can be set to "1" to
change the SDL coordinate system units to be DPI-scaled points, rather
than pixels everywhere.

This means windows will be appropriately sized, even when created on
high-DPI displays with scaling.

e.g. requesting a 640x480 window from SDL, on a display with 125%
scaling in Windows display settings, will create a window with an
800x600 client area (in pixels).

Setting this to "1" implicitly requests process DPI awareness
(setting SDL_WINDOWS_DPI_AWARENESS is unnecessary),
and forces SDL_WINDOW_ALLOW_HIGHDPI on all windows.
2022-06-11 14:19:01 -07:00
chalonverse
6f69bbc541 D3D11: Fix SDL_TEXTUREACCESS_TARGET not working if SDL_HAVE_YUV was 0
Added a couple of missing SDL_zeros in CreateTexture
2022-06-08 12:51:09 -07:00
chalonverse
8303c5d0a3 Added missing SDL_zero for renderTargetViewDesc 2022-06-08 12:51:09 -07:00
chalonverse
7a335df9cf Updated CMakeLists.txt and configure.asc/script so that it checks for the required Windows SDK version before it enables the d3d12 renderer. Also fixed reported warnings in some builds. 2022-06-07 17:07:33 -07:00
Sylvain
2cc2260435
Fixed bug #5768 - SDL_RenderGeometry's software backend failed to render when texture coordinates are reversed
handle flip vertical/horizontal when reconstructing rects from triangles
2022-06-07 16:30:01 +02:00
chalonverse
4082821822
DirectX 12 Renderer (#5761)
* DirectX 12 Renderer (27 squashed commits)

* Add missing SDL_hidapi.h of merge of SDL.vcxproj.filters

* Fixed OpenWatcom build failure

* Dynapi fix

Co-authored-by: Ryan C. Gordon <icculus@icculus.org>
2022-06-06 17:42:30 -07:00
Sam Lantinga
ae2cc29f8b Make sure initial state is set correctly for the D3D renderer
Fixes https://github.com/libsdl-org/SDL/issues/5749
2022-06-03 09:44:34 -07:00
Cameron Cawley
9dfa000bc0 Initial support for building for Windows with OpenWatcom 2022-05-19 20:11:10 +03:00
Cameron Cawley
c8eea02071 Fix C89 build errors in Windows builds 2022-05-18 15:03:15 -07:00
Alex Szpakowski
ec8fa57750 macOS: always use Objective-C ARC (automatic ref counting).
Change Cocoa SDL_VideoData and SDL_WindowData implementations from C structs to Objective-C objects, since bridging between C and ObjC is easier that way.
2022-05-09 21:53:40 -07:00
Eddy Jansson
9e5cbf034a Disallow non-positive allocation.
Ensure that we're not trying to call SDL_small_alloc()
with a count of zero.

Transforming the code like this fixes a
-Wmaybe-uninitialized warning from GCC 12.0.1
2022-04-29 18:34:13 -07:00
Eddy Jansson
6c2928b4be Switch uses of MIN() to SDL_min()
We're excluding files in src/hidapi to minimize the
diff against the upstream project.
2022-04-29 10:39:51 -07:00
Sam Lantinga
981e1e3c44 Fixed logical size synchronization issue on macOS
https://discourse.libsdl.org/t/sdl-2-0-22-prerelease/35306/6
2022-04-23 10:35:05 -07:00
Jaylon Gowie
d9009388c8 SceKernelMemBlockType to unsigned int 2022-04-19 14:17:27 -07:00
Jaylon Gowie
3753a7b1c3 Fix recent changes in VitaSDK 2022-04-19 14:17:27 -07:00
Sam Lantinga
b9fe6ba0e7 Fixed compile warnings 2022-04-18 13:09:08 -07:00
Sylvain
1ede941f5c SDL_render.c: internally change viewport/cliprect type from SDL_FRect to SDL_DRect (double precision). (see bug #5547) 2022-04-18 12:26:32 -07:00
pionere
0adb67017b avoid NullPointer in SDL_GetRenderTarget 2022-04-15 15:47:35 -04:00
Ethan Lee
ba0ba9ef16 direct3d11: Set the swapchain target immediately after creating it.
Fixes #4782
2022-04-07 23:47:20 -07:00
Ethan Lee
cb81630816 render: Update the size/scale/viewport on moves, in addition to resizes.
For OpenGL this means resetting the viewport state shadowing flag too.

Fixes #1504
2022-04-07 23:38:33 -07:00
Cameron Cawley
57118fb7de render: Fix setting the scale mode for non-native textures 2022-04-02 09:51:28 -07:00
Ivan Epifanov
95c0fec518 Vita: PVROGL: fix indentation and ifdef guards 2022-03-31 06:02:50 -07:00
Jaylon Gowie
8c542a3591 Desktop OpenGL 1.X/2.X PSVita Support 2022-03-31 00:02:56 -04:00
Mathieu Eyraud
1db47d468a Fix potential memory leak in QueueCmdFillRects 2022-03-28 08:34:32 -07:00
Ivan Epifanov
95ed83137f Vita: Use preallocated memory pool for textures 2022-03-27 10:07:49 -07:00
Ryan C. Gordon
7bc498d325
direct3d: Implement missing blend operations.
This is only for Direct3D 9; Direct3D 11 already had this implemented.

Fixes #5375.
2022-03-27 09:14:07 -04:00
Ivan Epifanov
69d0b6e3c6 Vita: Fix NULL-pointer dereference 2022-03-25 09:29:20 -04:00
Ryan C. Gordon
4fe7b2cbd1
static analysis: Fixed several complaints from codechecker.
There are still some pending Objective-C specific issues.

Reference issue #4600.
2022-03-24 11:00:43 -04:00
Ivan Epifanov
eadc064e2c Vita: add native YUV textures support.
* Fail if texture init fails.
* Refactor and cleanup.
2022-03-24 07:51:20 -04:00
Sylvain Becker
c23a7ad38a
Add SDL_RenderGetWindow() API to get the window associated with a renderer (#5440)
Add SDL_RenderGetWindow() API to get the window associated with a renderer
2022-03-23 17:07:56 +01:00
Sylvain
83df4a354e
SDL_render.c: remove unsused case, since renderer target has been forced to NULL previously (see bug #4213) 2022-03-22 15:25:01 +01:00
Sylvain
9dc201d448
Fixed bug #2962 - when SDL_RenderReadPixels format = 0, used format of the target texture
include/SDL_render.h, format:
"0 to use the format of the rendering target "
2022-03-21 10:41:14 +01:00
Ryan C. Gordon
d81fee7623
SDL_Rect: Added floating point versions of all the rectangle APIs.
Fixes #5110.
2022-03-19 10:35:24 -04:00
Sylvain
b2db570ce9
SDL_triangle_blit_slow: sync code with SDL_blit_slow to handle ARGB2101010 2022-03-16 18:09:40 +01:00
Sylvain Becker
3bebdaccb7 METAL: clip rect w/h must be <= render pass 2022-03-15 10:37:17 +01:00
Ozkan Sezer
bf69868924 reduced a few ifdefs, fixed an unused warning if built w/o SDL_HAVE_YUV. 2022-03-10 01:55:04 +03:00