Commit graph

112 commits

Author SHA1 Message Date
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
Ryan C. Gordon
10e2ce9ba4
examples: Added audio/04-multiple-streams 2024-11-24 15:05:44 -05:00
Ryan C. Gordon
61ba8010d3
examples: Emscripten builds should allow memory growth.
Otherwise you either need to preallocate a bunch or run out of memory fast.

examples/demo/04-bytepusher runs out of memory at startup without this.
2024-11-23 00:01:18 -05:00
Ryan C. Gordon
212f0dcdb1
examples: Fix output name of demos.
Otherwise, build-web-examples.pl will fail.
2024-11-22 17:29:43 -05:00
Ryan C. Gordon
f9ddb0bdea
examples/demo/04-bytepusher: No need to check NULL before destroying things. 2024-11-22 17:12:14 -05:00
Ozkan Sezer
7bf3cae02e examples: fix cmake after commit 51637495 2024-11-23 00:56:40 +03:00
Ryan C. Gordon
51637495e4
examples: Rename "game" to "demo". 2024-11-22 15:56:09 -05:00
Maia
566f3dc138 Add BytePusher example 2024-11-22 15:54:45 -05:00
ChillerDragon
7f14eb33c6 snake: improve comment 2024-11-14 22:40:07 -08:00
Wouter Wijsman
e31e3caece PSP: Fix building examples in parallel 2024-11-01 09:55:20 -07:00
expikr
d6b60bcc53 typo in player spawnpos, mov drawcall out of loop 2024-10-30 11:22:29 -04:00
Sam Lantinga
bdf16628fb Added 03-infinite-monkeys example game
This isn't really a game, more of an exercise of that age old question...
2024-10-29 13:08:59 -07:00
Sam Lantinga
2b92dc9baa Minor updates to woodeneye-008.c from template.c 2024-10-29 13:08:59 -07:00
Sam Lantinga
9a77ee2008 Added instructions for creating Visual Studio projects for examples 2024-10-29 13:08:59 -07:00
expikr
1e7c186461
Splitcreen FPS example with multiple mouse and keyboard (#11317) 2024-10-29 07:30:10 -07:00
Anonymous Maarten
590e1196d0 snake: check allocated memory before use 2024-10-25 17:47:26 +02:00
Michael Palomas
21c91d5535 examples now using SDL_ALPHA_OPAQUE(_FLOAT) for opaque alpha value 2024-10-23 07:28:33 -07:00
Ryan C. Gordon
e254c99b38
examples/game/01-snake: Update game logic in AppIterate, don't use a timer.
Reference Issue #11210.
2024-10-14 23:17:23 -04:00
Ryan C. Gordon
c20918b0fb render: Add SDL_RenderDebugText().
Fixes #11201.
2024-10-14 02:45:33 -04:00
Ryan C. Gordon
659f2f4b04
examples: add basic app metadata to all existing examples. 2024-10-07 17:41:15 -04:00
Simon McVittie
ee7f61fd9a snake: Add extended app metadata
All of these are optional, but nice-to-have, and we have reasonable
values available for all of them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-07 16:47:36 -04:00
Simon McVittie
ca82405d5a snake: Add basic app metadata
All SDL3 applications and games should ideally have this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-07 16:47:36 -04:00
Ryan C. Gordon
fca05fa754 examples: Use SDL_Log() instead of message boxes for errors.
Fixes #11094.
2024-10-06 22:38:04 -04:00
Ryan C. Gordon
1787d6ca5c main: SDL_AppQuit() now reports the result value.
Fixes #10994.
2024-09-29 23:24:04 -04:00
Ryan C. Gordon
86ea283904
examples: No need to explicitly seed the RNG at startup.
SDL does this for you; explicit seeding is only for reproducing a specific
sequence of numbers (or maybe reseeding at a later point).
2024-09-26 15:01:04 -04:00
Ryan C. Gordon
54459def69 render: Remove the logical presentation render target.
Now we render directly to the window, scaling as appropriate. This fixes some
concerns the render target introduced, like the quality of the final scaled
output, how to step outside of the logical size temporarily to draw some
things sharply at the native resolution, and loss of sub-pixel precision.

Fixes #8736.
2024-09-25 16:26:36 -04:00
Ryan C. Gordon
b48f29dd9b examples: Fix name of renderer/17-read-pixels binary. 2024-09-25 16:26:36 -04:00
Ryan C. Gordon
fcab6c99fb
examples: Fixed some window titles. 2024-09-24 15:36:49 -04:00
Ryan C. Gordon
9881c4e582
examples: Added renderer/17-read-pixels 2024-09-24 15:31:21 -04:00
Ryan C. Gordon
62389ada6f
examples/renderer/02-primitives: seed the RNG. 2024-09-24 13:55:29 -04:00
Ryan C. Gordon
95134f6d58
examples: Added renderer/15-cliprect 2024-09-24 13:55:28 -04:00
Ryan C. Gordon
1ed3dac021
examples: Added renderer/14-viewport
(This intentionally skips a few example numbers, as I intend to fill in some
other topics before this, later.)
2024-09-23 14:16:32 -04:00
Ryan C. Gordon
e00ea27d25
examples/renderer/01-clear: No longer needs vsync.
This now chooses the next color based on time, so it won't go wild if the
framerate is unbounded.
2024-09-23 14:16:32 -04:00