Commit Graph

87 Commits

Author SHA1 Message Date
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
Ryan C. Gordon
e973b687cd
examples: Added renderer/11-color-mods 2024-09-23 01:21:40 -04:00
Ryan C. Gordon
1828bde49f
examples/renderer/01-clear: Use the color-cycle code from testvulkan.c
(and testgpu_simple_clear.c, of course!)
2024-09-22 16:10:57 -04:00
Ozkan Sezer
b736285053 examples/renderer/08-rotating-textures: Fix compiler warning on MSVC . 2024-09-22 12:02:50 +03:00
Ryan C. Gordon
37d62deca1
examples/renderer/10-geometry: Fixes and cleanups. 2024-09-22 01:15:19 -04:00
Ryan C. Gordon
0758b2a0c4
examples: Added renderer/10-geometry 2024-09-22 01:10:33 -04:00
Ryan C. Gordon
1a90e09262
examples: Added renderer/09-scaling-textures 2024-09-22 01:10:32 -04:00
Ryan C. Gordon
4fdeb6861b
examples: a few renderer fixes. 2024-09-22 01:10:32 -04:00
Ryan C. Gordon
66b92e95ac
examples: renamed renderer sources to match other example directories. 2024-09-22 01:10:32 -04:00
Ryan C. Gordon
ffcf372d27
examples: Added renderer/08-rotating-textures 2024-09-22 01:10:31 -04:00
Ryan C. Gordon
0c7334cce3
examples: Added renderer/07-streaming-textures 2024-09-22 01:10:31 -04:00
Ryan C. Gordon
2bd3d9cfb7
examples: Added renderer/06-textures 2024-09-22 01:10:30 -04:00
Ryan C. Gordon
9d0b3eded6
examples: added renderer/05-rectangles 2024-09-22 01:10:30 -04:00
Ryan C. Gordon
3413617cb6
examples: added renderer/04-points 2024-09-22 01:10:30 -04:00
Ryan C. Gordon
b4e2777820
examples/renderer/03-lines: Fix compiler warning on Visual Studio. 2024-09-19 13:31:24 -04:00
Ryan C. Gordon
2e3e5abd7d
examples/renderer/03-lines: use a gray background. 2024-09-19 12:58:37 -04:00
Ryan C. Gordon
745d5e4991
examples/renderer/03-lines: Make this less obnoxious to look at. 2024-09-19 12:52:04 -04:00
Ryan C. Gordon
1b266ec13d
examples: added renderer/03-lines 2024-09-19 12:16:12 -04: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
f3e419596b Removed SDL_INIT_TIMER
This is no longer necessary before calling SDL_AddTimer()
2024-09-17 08:53:27 -07:00
Ryan C. Gordon
f4c2c09f78
examples: Link to SDL integer types in code examples, too. 2024-09-09 15:41:28 -04:00
Ryan C. Gordon
154452a726 winrt: Removed WinRT/Windows Phone/UWP support.
Fixes #10724.
2024-09-06 13:28:39 -04:00
Sam Lantinga
575d9cda6f The parameter to SDL_AppEvent() should be non-const
This allows functions like SDL_ConvertEventToRenderCoordinates() to work without having to copy the event.

Fixes https://github.com/libsdl-org/SDL/issues/10691
2024-09-03 08:18:36 -07:00
Ryan C. Gordon
c38d3f0fe4
examples/game/01-snake: Remove RNG abstraction. 2024-08-30 17:13:51 -04:00
Ryan C. Gordon
29b9b163b9
example/game/01-snake: Make the "food" rectangles lighter blue. 2024-08-30 15:12:22 -04:00
Ryan C. Gordon
f6fc5e2881
examples: Smush game/01-snake into one source file, clean up some things. 2024-08-30 13:47:41 -04:00