Commit graph

144 commits

Author SHA1 Message Date
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
- 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 0f128fd7c5/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
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.
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
Ryan C. Gordon
4d4a2786bb render: Updates to format-string versions of SDL_RenderDebugText.
- Removes SDL_RenderDebugTextV
- Changes SDL_RenderDebugTextF to SDL_RenderDebugTextFormat and tweaks it to
  work in a world without SDL_RenderDebugTextV.
- Tweaked rendering position of formatted text in the example program.
2024-12-18 10:40:31 -05:00
williamist
6abebca943 Fix format string in debug-text example
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-12-18 10:40:31 -05:00
williamistGitHub
1d0e28a5b3 Add SDL_RenderDebugTextF & SDL_RenderDebugTextV
This should make it easier to quickly put important numbers and such on
the screen without having to format them into a string manually.
2024-12-18 10:40:31 -05:00
Ryan C. Gordon
bbd4eeb287
examples/audio/04-multiple-streams: Note about web browser audio in README. 2024-12-11 14:13:52 -05:00
Ryan C. Gordon
3f425b6f20
examples/audio/04-multiple-streams: Patched to compile on Visual Studio. 2024-12-11 13:25:43 -05:00
Ryan C. Gordon
1fbb8e1824
examples/audio/04-multiple-streams: Remove drag-and-drop support.
I'm going to reuse that code for an actual drag/drop example later, but for
simplicity and accessibility of the examples, this is just going to load two
wavs and loop them, so you get the music with a sword-clinking sound mixed
over it.
2024-12-10 23:10:43 -05:00
Ryan C. Gordon
0f228de48a
examples: Add some metadata to the generated webpages. 2024-12-06 13:08:26 -05:00
Nicolas Allemand
1a5b0796b4 examples: fix canvas size for small screens 2024-12-06 06:58:10 -08:00
Ryan C. Gordon
90efb63e52
examples: Improve webpage generation in various ways, add thumbnails, etc. 2024-12-05 23:58:23 -05:00
Ryan C. Gordon
e50dc7265b
examples: Fix some window titles in the demos. 2024-12-05 23:58:23 -05:00
Nicolas Allemand
a0b8b57afe examples: add empty placeholder image 2024-12-05 00:29:03 -08:00
Nicolas Allemand
58f8e259d1 examples: fixup URLs for project subfolder 2024-12-04 19:37:50 -05:00
Nicolas Allemand
56da4e81d8 examples: added homepage + categories pages + added CSS (similar to wiki) 2024-12-04 19:37:50 -05:00
Ryan C. Gordon
e79ce2a200 asyncio: Added async i/o APIs. 2024-12-03 17:32:20 -05:00
Ryan C. Gordon
1720fc77fe
examples: Added input/02-joystick-events 2024-11-24 22:49:07 -05:00
Ryan C. Gordon
a07a88c1b4
examples: added input/01-joystick-polling 2024-11-24 22:49:06 -05:00