Lightly edited the document (as disucsed in #1404).

master
Carl Smith 4 vuotta sitten
vanhempi
commit
15362188bd
1 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. +7
    -4
      raylib-data-structures.md

+ 7
- 4
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)

Ladataan…
Peruuta
Tallenna