Commit Graph

16405 Commits

Author SHA1 Message Date
Ryan C. Gordon d2e2b9bdc9
examples: Maybe fix Android builds. 2024-07-23 01:25:29 -04:00
Ryan C. Gordon d8d7212efd
examples: Maybe fix UWP builds. 2024-07-23 01:22:19 -04:00
Ryan C. Gordon a03ecaacb0
workflows: Enable building examples on GitHub Actions. 2024-07-23 01:04:05 -04:00
Ryan C. Gordon 16535b7ee2
examples: Add CMake glue to optionally build examples, as we do for the tests.
In fact, most of the CMake code was stolen from the test directory.
2024-07-23 00:58:57 -04:00
Ryan C. Gordon 2038620717
examples/README: fixed typo. 2024-07-22 23:41:16 -04:00
Ryan C. Gordon 15562564ad
build-web-examples: Run highlight with `--enclose-pre` option. 2024-07-22 23:23:53 -04:00
Ryan C. Gordon 549317e0e4
build-web-examples: Minor tweaks. 2024-07-22 23:05:59 -04:00
Ryan C. Gordon 2de83359ba
build-web-examples: Fix CMake dir. 2024-07-22 22:55:41 -04:00
Ryan C. Gordon 70348d77e1
build-web-examples: It's usually `/bin/bash` on Linux, not `/usr/bin/bash`. 2024-07-22 22:42:32 -04:00
Ryan C. Gordon 5339b4458d
examples: Added initial examples infrastructure. 2024-07-22 22:39:09 -04:00
Ryan C. Gordon 2f6e34d2d0
wikiheaders: Added copyright comment to the top of file. 2024-07-22 22:39:09 -04:00
SDL Wiki Bot 2aea74aa84 Sync SDL3 wiki -> header 2024-07-22 22:19:38 +00:00
Sam Lantinga a36be94ad1 More clarification on temporary memory 2024-07-22 15:19:26 -07:00
Sam Lantinga 29f0fd33dc SDL_getenv() should return const
This also allows us to use SDL_FreeLater() and make SDL_getenv() thread-safe on Windows.
2024-07-22 13:00:39 -07:00
Sam Lantinga ef21e31a9a SDL_GUIDFromString() renamed SDL_StringToGUID() 2024-07-22 12:39:15 -07:00
SDL Wiki Bot 5e12706ae0 Sync SDL3 wiki -> header 2024-07-22 17:05:52 +00:00
Eduard Gushchin 24bb95f60c Fixed a typo in the name of the method in the documentation for SDL_GetDisplayProperties 2024-07-22 10:04:59 -07:00
Sam Lantinga c4bf5f9f59 SDL_CreateTexture() uses the SDL_TextureAccess type for the access parameter 2024-07-22 09:32:02 -07:00
Frank Praznik b0713a7d30
x11: Track cursor visibility internally
Cursor visibility in the SDL input layer only reflects whether ShowCursor/HideCursor was called. In the case of relative mode, the cursor can be hidden, but the SDL_Mouse visibility flag will be true.

Track cursor visibility separately in the X11 driver. Fixes the cursor becoming visible when using the warping relative mode with XWayland.
2024-07-22 12:03:07 -04:00
SDL Wiki Bot 3e943090d0 Sync SDL3 wiki -> header 2024-07-22 14:50:48 +00:00
Eduard Gushchin 61565b7f61 Update SDL_video.h
Led to the actual list of WindowsFlag in the documentation of the SDL_CreateWindow method
2024-07-22 07:50:07 -07:00
SDL Wiki Bot 40cb3fb74a Sync SDL3 wiki -> header 2024-07-22 14:35:35 +00:00
Sam Lantinga ff1d351390 Removed SDL_FreeTemporaryMemory()
This was just causing confusion and anxiety. SDL temporary memory will be automatically freed on the main thread when processing events and on other threads when it ages out after a second. The application can free it directly by calling SDL_ClaimTemporaryMemory() to get ownership of the pointer, if necessary.
2024-07-22 07:34:25 -07:00
Ozkan Sezer 70c1012e8c SDL_stdinc.h (SDL_COMPILE_TIME_ASSERT): Keep C++ case alone (after PR/10331)
Some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode.
Reference issue: https://github.com/libsdl-org/SDL/issues/6078 which was fixed by
f6b81125b3
2024-07-22 16:00:37 +03:00
SDL Wiki Bot 230f2a684d Sync SDL3 wiki -> header 2024-07-22 12:59:19 +00:00
Sam Lantinga 685e381735 Add an overview of how to handle temporary memory 2024-07-22 05:58:19 -07:00
Sam Lantinga 9bfd0d901c Audio device IDs are unsigned 2024-07-22 05:48:01 -07:00
Sam Lantinga 033c9c5951 Added SDL_CopyFile() and SDL_CopyStorageFile()
Fixes https://github.com/libsdl-org/SDL/issues/9553
2024-07-21 19:58:23 -07:00
Sam Lantinga 128df75e05 Fixed potential NULL dereference 2024-07-21 14:32:19 -07:00
Sam Lantinga bd27b89903 Prevent potential overflow in rectangle functions
We're limiting the functions to rects with positions and sizes < 1 billion for speed, which is totally fine for most SDL use cases. If you need rectangles larger than that, you can roll your own functions that use 64-bit intermediate values and do proper overflow handling of output values.

Fixes https://github.com/libsdl-org/SDL/issues/8879
2024-07-21 13:04:11 -07:00
Anonymous Maarten 22bfbdbc02 stdinc: c23 deprecated _Static_assert in favor of static_assert 2024-07-21 21:51:55 +03:00
Sam Lantinga 4830fc4e40 Added more 8-bit blit test coverage 2024-07-21 11:39:38 -07:00
Sam Lantinga bab982f2e0 Don't recalculate the blit mapping when changing surfaces
We don't actually need to change the blit mapping if we're targeting a new surface with the same format and palette.
2024-07-21 11:39:38 -07:00
Dragon-Baroque 68cabc2837 Support SDL_EVENT_DROP_TEXT in Cocoa
src/video/cocoa/SDL_cocoawindow.m
    Support Copy in addition to Generic as Drag and Drop operation,
    Register and Support public.utf8-plain-text for SDL_EVENT_DROP_TEXT.
2024-07-21 11:17:04 -07:00
Sam Lantinga c040a02d6c Removed SDL_PROP_SURFACE_COLORSPACE_NUMBER
Now that we have surface internal data, we can store it there. This slightly improves performance in the surface blitting paths.
2024-07-21 09:36:22 -07:00
SDL Wiki Bot 4a7e95402f Sync SDL3 wiki -> header 2024-07-21 15:09:24 +00:00
Sam Lantinga e0fd59de64 Fixed floating point rectangles to be mathematically correct.
* A floating point rectangle contains all points >= x and <= x + w
* A floating point rectangle is only empty if it has negative width. The zero rectangle contains the zero point.
* Adjacent floating point rectangles intersect along their shared side

Fixes https://github.com/libsdl-org/SDL/issues/6791
2024-07-21 08:08:15 -07:00
Sam Lantinga 9e978740c3 Removed unnecessary casts 2024-07-21 08:08:15 -07:00
Sam Lantinga 35ae56d344 Switched the rectangle tests to listing by name instead of by number. 2024-07-21 08:08:15 -07:00
Sam Lantinga f244f08165 Fixed building with SDL_VIDEO_OPENGL_WGL disabled (thanks @Please-just-dont!)
Fixes https://github.com/libsdl-org/SDL/issues/10330
2024-07-20 21:24:02 -07:00
Sam Lantinga 78991bdb13 Revert "SDL_BlitSurfaceUnchecked() should invalidate the map when switching from scaled to unscaled blits"
This reverts commit 1f3b2fc8b3.

SDL_BlitSurface() also handles scaling, so we shouldn't clear the scaling flag inside of it.
2024-07-20 21:17:15 -07:00
Sam Lantinga b0a6afaa35 Updated documentation for SDL_GetPreferredLocales() 2024-07-20 20:12:55 -07:00
Sam Lantinga bce6d5b421 Actually, we still need size overflow checking in SDL_BlitSurfaceUncheckedScaled() 2024-07-20 18:53:31 -07:00
Sam Lantinga 9bdb3e8b6a Moved some error checking out of SDL_BlitSurfaceUncheckedScaled() 2024-07-20 18:51:42 -07:00
Sam Lantinga 1f3b2fc8b3 SDL_BlitSurfaceUnchecked() should invalidate the map when switching from scaled to unscaled blits 2024-07-20 18:44:23 -07:00
SDL Wiki Bot 979c71b18b Sync SDL3 wiki -> header 2024-07-21 01:22:39 +00:00
Sam Lantinga 6209c71f54 Added SDL_BlitSurface9Grid() and SDL_RenderTexture9Grid() 2024-07-20 18:21:19 -07:00
Sam Lantinga 9294476788 Added SDL_WriteSurfacePixel() and SDL_WriteSurfacePixelFloat() 2024-07-20 18:21:19 -07:00
Sam Lantinga 12e50d17a2 Removed SDL_SoftStretch() from the public API
SDL_BlitSurfaceScaled() is more flexible and uses the SDL_SoftStretch() fast path when possible. Having two surface scaling APIs was confusing, especially when one of them has unexpected limitations.
2024-07-20 18:21:19 -07:00
Sam Lantinga 5ce81ebcc9 Corrected blit colorkey documentation
Fixes https://github.com/libsdl-org/sdlwiki/issues/576
2024-07-20 18:21:19 -07:00