Commit Graph

1665 Commits

Author SHA1 Message Date
Sam Lantinga 1834c83d5a testplatform: make sure bool is 1 byte 2024-09-18 10:01:15 -07:00
Sam Lantinga a90ad3b0e2 Removed SDL_bool in favor of plain bool
We require stdbool.h in the build environment, so we might as well use the plain bool type.

If your environment doesn't have stdbool.h, this simple replacement will suffice:
typedef signed char bool;
2024-09-18 08:32:30 -07:00
Sam Lantinga bd04459cde Fix typos (thanks @qndel!)
Fix typos in comments and in one case in a returned error ("insuffient -> insufficient" fb273eb)
codespell src/ *.cpp *.h *.hpp --ignore-words-list unknwn,thid,algebric,statics,pixelX,pEvents,caf,ptd,parms,pEvent,parm,TextureRS,TE,HDA,LOD,datas,UE,xwindows,IIF
cd src; git checkout \
    events/imKStoUCS.* \
    hidapi \
    joystick/controller_type.c \
    joystick/controller_type.h \
    joystick/hidapi/steam/controller_constants.h \
    joystick/hidapi/steam/controller_structs.h \
    libm \
    stdlib/SDL_malloc.c \
    stdlib/SDL_qsort.c \
    stdlib/SDL_strtokr.c \
    video/khronos \
    video/x11/edid.h \
    video/x11/edid-parse.c \
    video/x11/xsettings-client.* \
    video/yuv2rgb
2024-09-18 08:18:26 -07:00
Frank Praznik e4f987f299
tests: Fix testdropfile on high-DPI displays
Convert the window pointer coordinates to buffer coordinates for rendering, so that the cross-hairs align with the cursor on scaled desktops.
2024-09-18 11:00:19 -04:00
Ozkan Sezer 8caf25f7b3 testautomation_stdlib.c (stdlib_strtox): fix warning from gcc-4.9:
test/testautomation_stdlib.c: In function 'stdlib_strtox':
test/testautomation_stdlib.c:1339:9: warning: this decimal constant is unsigned only in ISO C90
         STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967295", 10, 4294967295, 10);
         ^
test/testautomation_stdlib.c:1340:9: warning: this decimal constant is unsigned only in ISO C90
         STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967296", 10, 4294967295, 10);
         ^
2024-09-18 01:03:10 +03:00
Sam Lantinga 8d223b3037 Renamed atomic functions to match SDL 3.0 naming convention
This will also allow us to cleanly add atomic operations for other types in the future.
2024-09-17 08:53:27 -07:00
Sam Lantinga f3e419596b Removed SDL_INIT_TIMER
This is no longer necessary before calling SDL_AddTimer()
2024-09-17 08:53:27 -07:00
Sam Lantinga 231ea07617 Added SDL_LogTrace() 2024-09-17 02:04:54 -07:00
Sam Lantinga dc639956ba Improve logging performance and make log priorities thread-safe
Fixes https://github.com/libsdl-org/SDL/issues/9679
2024-09-16 13:09:17 -07:00
Caleb Cornett 9416917353
GPU: Rework MSAA (#10859) 2024-09-16 12:19:09 -05:00
Sam Lantinga 0548050fc5 Verify that the subsystems were successfully initialized 2024-09-15 12:04:10 -07:00
Carl Åstholm 1f3fd65c4c cpuinfo: Rename SDL_GetCPUCount to SDL_GetNumLogicalCPUCores
This was the only API that broke the "GetNumThings" convention
used elsewhere, so renaming it helps with consistency.
Adding "logical cores" to the name also makes it a bit
more immediately obvious what the count actually represents.
2024-09-14 19:33:30 -07:00
Ryan C. Gordon 93bf534268
testgpu_simple_clear: Fixed AppInit return values. 2024-09-14 19:19:27 -04:00
Sam Lantinga e97f636590 SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER is an SDL_Environment pointer 2024-09-14 12:27:22 -07:00
Sam Lantinga e673479449 Removed SDL_WriteProcess()
This had the unfortunate side-effect of blocking if you tried to write too much. Instead you can use SDL_GetProcessInput() and handle SDL_IO_STATUS_NOT_READY as needed.

Fixes https://github.com/libsdl-org/SDL/issues/10834
2024-09-14 11:15:50 -07:00
ritalat f6f49de134 Add convenience functions to get process IOStreams 2024-09-14 10:33:29 -07:00
Sam Lantinga aa7357a14d SDL_CreateEnvironment() fills the environment with a non-zero parameter 2024-09-14 10:29:02 -07:00
Semphris 3cf54675bb Windows process: escape backslashes before quotes 2024-09-13 22:15:56 -07:00
Sam Lantinga 90e01040c5 Added thread-safe environment functions
Also marked the existing functions as unsafe, as they can cause crashes if used in multi-threaded applications.

As a bonus, since the new functions are hashtable based, hint environment lookups are much faster.
2024-09-13 22:14:54 -07:00
Semphris 9eea8234e6 Add SDL_Process subsystem 2024-09-13 15:19:32 -07:00
Carl Åstholm 84361bcf0a stdlib: Remove test cases with impl-defined results 2024-09-13 12:30:58 -07:00
Carl Åstholm eb199176e6 stdlib: Conditionally undef some SDL_strtox tests
Some test cases have implementation-defined results,
so we should only test these when we know SDL's own
implementations of the functions are used.
2024-09-13 12:30:58 -07:00
Carl Åstholm 59ec034412 stdlib: Use macros to define SDL_strtox tests 2024-09-13 12:30:58 -07:00
Carl Åstholm a78f612d4b stdlib: Add some tests for SDL_strtod 2024-09-13 12:30:58 -07:00
Carl Åstholm 61bc856b04 stdlib: Use new parser for scanf %p specifier 2024-09-13 12:30:58 -07:00
Carl Åstholm e109aa09aa stdlib: Rewrite SDL_strto(ll?|ul) impl 2024-09-13 12:30:58 -07:00
Carl Åstholm e326540a45 stdlib: Add failing tests for SDL_strto(ll?|ul) 2024-09-13 12:30:58 -07:00
Carl Åstholm 5331f36789 stdlib: Add failing tests for SDL_strtoull 2024-09-13 12:30:58 -07:00
Carl Åstholm 5d30980df4 stdlib: Add failing tests for SDL_wcstol
These help illustrate some key differences between a specs-compliant
libc wcstol and SDL's own implementation.
2024-09-13 12:30:58 -07:00
Ethan Lee 96e147b2b9 gpu: Rework driver name queries, add GetGPUShaderFormats 2024-09-13 12:29:40 -04:00
Caleb Cornett a45a2caf49
GPU: Rename VertexBinding to VertexBufferDescription (#10811) 2024-09-12 18:02:39 -05:00
Petar Popovic fd2a266549 Adding void to empty function prototype parenthesis 2024-09-11 19:44:52 -07:00
Sam Lantinga 3f7f6f624b testcolorspace: don't tonemap from HDR to SDR when reading pixels
Our source content is in the SDR range, so we don't need to tonemap when reading it back.
2024-09-11 14:23:58 -07:00
Sam Lantinga 4e43da684c Added texture colorspace testing 2024-09-11 14:23:58 -07:00
Sam Lantinga 37c9fb490e Changed enums to use XXX_COUNT for the count or number of values
Fixes https://github.com/libsdl-org/SDL/issues/10763
2024-09-11 09:32:17 -07:00
Petar Popovic 6fca867ffe Fix testoffscreen.c: bool literal returned from 'main' 2024-09-11 01:49:45 -04:00
Evan Hemsley 0b6f993dea
GPU: Zero-init handling (#10786) 2024-09-10 18:17:08 -07:00
Sam Lantinga 4eb4370500 SDL_strtoll(), SDL_strtoull(), SDL_lltoa(), and SDL_ulltoa() use long long values 2024-09-09 15:46:26 -07:00
Sam Lantinga 6fc6e3dc7e Use SDL_bool where appropriate in SDL events
This involved changing button state from Uint8 to SDL_bool, and made SDL_PRESSED and SDL_RELEASED unnecessary.

Fixes https://github.com/libsdl-org/SDL/issues/10069
2024-09-09 14:00:19 -07:00
cosmonaut d3091b9538 Remove SDL_GPUDepthStencilValue struct 2024-09-09 10:55:05 -07:00
Evan Hemsley 668e2f82d2
Add load op and clear color to SDL_BlitGPUTexture (#10767) 2024-09-09 10:19:52 -07:00
Anonymous Maarten c797ae1619 Fix -Wtype-limits warning
actual has type Uint8, so there's no need to compare against 0.
2024-09-09 14:40:50 +02:00
Petar Popovic d2ef15d8e6 Fix warnings: calloc-transposed-args 2024-09-08 19:28:11 -07:00
Evan Hemsley 68a9991ec9
GPU: Document structs (#10742) 2024-09-07 08:29:14 -07:00
Caleb Cornett 9730f62e8c
GPU: Rename struct members and parameters for SDL3 naming conventions (#10730)
---------

Co-authored-by: Evan Hemsley <2342303+thatcosmonaut@users.noreply.github.com>
2024-09-06 16:38:23 -07:00
Ryan C. Gordon 154452a726 winrt: Removed WinRT/Windows Phone/UWP support.
Fixes #10724.
2024-09-06 13:28:39 -04:00
Anonymous Maarten db96ddca34 SDL_test: use SDLCALL calling convention
This is needed when using a pre-built static SDL3_test library.
2024-09-06 14:19:05 +02:00
Sam Lantinga 702ed83f72 Initialize interface structures so they can be extended in the future
We guarantee that we will only add to the end of these interfaces, and any new fields will be optional.
2024-09-05 19:16:00 -07:00
Anonymous Maarten 434193d153 testmultiaudio: initialize audio through SDL_test framework 2024-09-06 03:06:40 +02:00
Anonymous Maarten 102b3b480b SDL_test: move argument parsing into SDL_test 2024-09-06 03:06:40 +02:00