Commit Graph
160 Commits
Author SHA1 Message Date
Ryan C. Gordon c78818bd4b examples: When linking to directories, append a '/' to the URL.
This works without it, but generates an extra redirect on the web server to
the same a URL with the '/' appended, so we might as well supply it ourselves
and remove the extra roundtrip to the server.
2025-09-12 14:23:01 -04:00
Sam Lantinga 9d6fb509fe cliprect example: allow the clipping rectangle to extend outside the destination
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2025-09-07 19:48:05 -07:00
Ryan C. Gordon a7ee54f9a3 examples/README: Added a note about generating onmouseevent and thumbnails.
So I don't have to figure this out every time I write a new example.
2025-09-07 17:45:38 -04:00
Ryan C. Gordon 7c6ecb1cc4 examples: Reencoded input/02-joystick-events/onmouseover.webp, much smaller. 2025-09-07 17:37:26 -04:00
Ryan C. Gordon a5d790124c examples: Added input/04-gamepad-events 2025-09-07 14:06:58 -04:00
Ryan C. Gordon cfa31df2d5 examples/input/03-gamepad-polling: Added some README notes about the web. 2025-09-07 11:48:53 -04:00
Ryan C. Gordon bab4bb3817 examples: Fixed HTML output with multi-paragraph READMEs. 2025-09-07 11:48:53 -04:00
Ryan C. Gordon 79b881fc2e examples: Minor tweak to joystick examples' comments. 2025-09-06 23:03:46 -04:00
Ryan C. Gordon cf92ef7994 examples: Added input/03-gamepad-polling 2025-09-06 23:03:04 -04:00
Cameron Cawley 41452ef4bf Remove unused OpenGL references in the examples CMakeLists 2025-09-03 15:43:59 -07:00
Cameron Cawley 54745c5cf4 Only bundle the required resources with examples on the 3DS 2025-09-03 15:43:59 -07:00
Cameron Cawley 20c00babbc Create an application bundle for examples on Mac OS X 2025-09-03 15:43:59 -07:00
Marcus Harrison b795762b62 Small fix for snake example (#13790)
Rename THREE_BITS to SNAKE_CELL_SET_BITS
Make SNAKE_CELL_SET_BITS depend on SNAKE_CELL_MAX_BITS
2025-08-27 05:16:24 -07:00
Michael Fitzmayer 7ae64592c9 Restore support for the Nokia N-Gage (#12148) 2025-05-22 11:07:22 -07:00
Maia cbf44700d8 bytepusher example: always render text to render target and remove unused variable 2025-04-28 09:40:07 -07:00
Ryan C. Gordon af0972c33f audio: SDL_PutAudioStreamPlanarData should take a channel count.
Fixes #12894.
2025-04-25 21:13:04 -04:00
Ryan C. Gordon e3507b390e examples: added audio/05-planar-data 2025-04-22 23:30:50 -04:00
Ryan C. Gordon 483d1c36ed comments: Fixed a few typos I ran into in the audio code. 2025-04-22 19:40:40 -04:00
Patrick José Pereira a1016bd06f Allow 01-joystick-polling example to be resizable
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2025-04-10 08:58:40 -07:00
Ryan C. Gordon 567dfd2ebc examples/renderer/19-affine-textures: add metadata for examples.libsdl.org. 2025-03-28 14:19:30 -04:00
Ryan C. Gordon 5ab1aef367 examples/renderer/19-affine-textures: blue background so you can see the cube. 2025-03-28 14:19:30 -04:00
Ozkan Sezer 87e6d2250f examples, affine-textures: fix RISC-OS build. 2025-03-28 20:56:50 +03:00
Ryan C. Gordon 254f348083 examples/renderer/19-affine-textures: Flip coords so SDL logo is right-side up. 2025-03-28 13:52:58 -04:00
Ryan C. Gordon 3915451058 examples/renderer/19-affine-textures: Whole source file was indented one space. 2025-03-28 13:15:04 -04:00
Ryan C. Gordon 2ebcee2033 examples: added examples/renderer/19-affine-textures to CMakeLists.txt. 2025-03-28 13:13:05 -04:00
Ryan C. Gordon 2207f6bc9a examples/renderer/affine-textures: Fixed compiler warnings. 2025-03-28 13:11:35 -04:00
expikr 83eea00d66 Create affine-textures.c 2025-03-28 10:06:29 -07:00
DamianS-eng 18185e30e9 Remove breaks under return 2025-03-15 16:19:36 -07:00
DamianS-eng 80ff0f45fd Move default 2025-03-15 16:19:36 -07:00
DamianS-eng 3b58ad9d48 Add breaks and defaults to switch statements 2025-03-15 16:19:36 -07:00
DamianS-eng 8b6e9936e0 Missed a bracket 2025-03-15 16:19:36 -07:00
DamianS-eng 36ec4cd397 Align spacing 2025-03-15 16:19:36 -07:00
DamianS-eng 3b90ce4995 Fix spacing; tabs to 4 spaces 2025-03-15 16:19:36 -07:00
DamianS-eng 60857935ca Add preliminary joystick support for snake example 2025-03-15 16:19:36 -07:00
Ryan C. Gordon f7cadcba84 examples: Use SDL_GetAudioStreamQueued, not SDL_GetAudioStreamAvailable.
The "available" side is at the mercy of whatever format the hardware wants,
but we control what we queued.

Fixes #12403.
2025-02-27 11:46:56 -05:00
Petar Popovic c70f54e28b Remove redundant casts 2025-02-21 10:09:10 -08:00
captain0xff b03332b68d updated bytepusher demo to be C++ compatible 2025-02-11 13:38:29 -08:00
captain0xff 5dd2492645 updated the snake demo to be C++ compatible 2025-02-11 13:38:29 -08:00
Christian Walter e29ebb9f18 Update geometry renderer example
This PR updates the geometry renderer example such that the `color` values of `vertices[3]` are set correctly in `SDL_AppIterate`.
2025-02-09 10:53:14 -08:00
Sam Lantinga 235022fe2f Fixed error C2059: syntax error: '}'
Fixes https://github.com/libsdl-org/SDL/issues/12155
2025-02-01 15:32:58 -08:00
Aki 943579a545 Fix inverted pen Y tilt on macOS and add tilt display to example
Build (All) / Create test plan (push) Waiting to run
Build (All) / level1 (push) Blocked by required conditions
Build (All) / level2 (push) Blocked by required conditions
- Negate tilt.y in Cocoa pen handling to correct inverted Y tilt axis
- Update drawing example to display X/Y tilt values for visualization
- see https://github.com/qt/qtbase/blob/0f128fd7c5a9ee721d1e631743f6eb61d927cf3b/src/plugins/platforms/cocoa/qnsview_tablet.mm#L63
- see https://source.chromium.org/chromium/chromium/src/+/main:components/input/web_input_event_builders_mac.mm;drc=0af5ffa1e4cc4cc4f818725f8fee93ec57855e4b;l=421
2025-01-29 22:09:02 -08:00
Klayism bb3c5b4f3a Fix multiple occurences of typo "an simple" to "a simple" 2025-01-21 14:00:54 -08:00
Nicolas Firmo 842f6dc402 Fixed wrong type of phase (#12014)
`phase` should be a `float` value that ranges between `0` and `1`.
2025-01-17 18:12:47 -08:00
Nicolas Firmo do Patrocinio Barra b95989d14a Fixed sine wave distortion over time.
Audio distortion after a while caused by loss of precision in dividing a large floating point number resolved by keeping `current_sine_sample` (formelly named `total_samples_generated`) between 0 and freq - 1.
2025-01-17 17:41:56 -08:00
expikr 569de84907 better numerical precision for playback example 2025-01-13 10:29:51 -08:00
mausimus 03a3c19c27 examples: use doubles to generate sine waves and avoid distortion 2025-01-13 09:50:45 -05:00
Sam Lantinga c4f2f7b352 Removed redundant information in example pages
This is large text and is already covered by the header and breadcrumb
2025-01-12 15:57:48 -08:00
Semphris dcc645e413 Fix HTML examples template tabs
Build (All) / Create test plan (push) Waiting to run
Build (All) / level1 (push) Blocked by required conditions
Build (All) / level2 (push) Blocked by required conditions
Tab labels now follow their drawer again. Also, to avoid tabs covering
up code or debugging logs, the tab label that's on top (and therefore
not automatically hidden behind the other drawer when that drawer
opens) will now automatically hide itself when the other drawer is
opened.
2025-01-05 11:39:20 -08:00
Ryan C. Gordon c030e6f782 examples/pen/01-drawing-lines: Match render target size to renderer output.
Build (All) / Create test plan (push) Waiting to run
Build (All) / level1 (push) Blocked by required conditions
Build (All) / level2 (push) Blocked by required conditions
Otherwise, on HiDPI displays (like a retina iPad), the lines you draw don't
match where the pen is touching.
2024-12-28 15:36:02 -05:00
Carl Åstholm a0e537b9c0 examples: Fix dead links in app metadata 2024-12-27 17:10:52 -08:00