Commit Graph

14 Commits

Author SHA1 Message Date
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
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
1787d6ca5c main: SDL_AppQuit() now reports the result value.
Fixes #10994.
2024-09-29 23:24:04 -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
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
Ryan C. Gordon
bc8b768b9a examples/snake: Fix up build. 2024-07-30 13:40:01 -04:00
Dylam De La Torre
dbb4e05c28 Add "Snake" game example 2024-07-30 13:26:01 -04:00