From 15362188bdf3603f851a74560f9568046c36e261 Mon Sep 17 00:00:00 2001 From: Carl Smith Date: Fri, 9 Oct 2020 02:24:36 +0100 Subject: [PATCH] Lightly edited the document (as disucsed in #1404). --- raylib-data-structures.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/raylib-data-structures.md b/raylib-data-structures.md index d9710a6..6698b7d 100644 --- a/raylib-data-structures.md +++ b/raylib-data-structures.md @@ -1,7 +1,9 @@ -raylib provides some basic data structures to organize game data. -Those structures are quite common in most of the engines out there. +raylib provides a set of data structures to help with organizing game data. +These structs are common to most engines, and will be familiar to anyone +who has authored video games before. ### raylib data structures + ```c Struct name [32bit size] [64bit change] Description ----------------------------------------------------------------------------------------------------------------------- @@ -54,9 +56,10 @@ Those structures are quite common in most of the engines out there. struct Music; [32 bytes] [+16 bytes] // Audio stream and music data pointer for streaming ``` -raylib abuses the data pass-by-value on most of its functions, actually, only around 10% of the functions require dealing with data pointers. For this reason, I tried to keep data structures as small as possible, usually under 64 bytes size, and use internal pointers when data requires modification by some function (usually Load/Update/Unload functions). +raylib slightly abuses the ability to pass-by-value. In fact, only around 10% of its functions need to deal with data pointers. With this in mind, data structures are kept as small as possible (usually under 64 bytes), and internal pointers are used with functions that need to modify the data (usually *Load*, *Update* and *Unload* functions). + +### raylib functions that modify data passed by reference -### raylib functions that require passing data by reference to be modified inside the function ```c // core.c char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed)