Skip to content

Commit 49b1fdb

Browse files
Add code style guidelines to README.md
1 parent 48931b4 commit 49b1fdb

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,27 @@ Please use the GitHub issue tracker for bug reports.
2929
### ToDos
3030

3131
- (Continously) Update files by new SDL2 functions and types which are present in more recent SDL2 versions.
32-
- (Continously atm.) Translate integer aliases into typed enums. See PR [#4](https://github.com/PascalGameDevelopment/SDL2-for-Pascal/pull/4) for reference.
32+
- (Continously atm.) Translate integer aliases into typed enums.
33+
See PR [#4](https://github.com/PascalGameDevelopment/SDL2-for-Pascal/pull/4) for reference.
3334
- (Continously) Check FPC/Delphi compatibility.
3435

36+
## Code style guidelines
37+
38+
The main principle is to stay as tight as possible at the names in the C headers.
39+
These guidelines aim to have better consistency in this community project and make
40+
it easier to find certain code parts in the C headers/Pascal includes. Feel free
41+
to discuss or extend these guidelines, use the issue tracker.
42+
43+
1. Names of C defines (constants) shall not be modified or "pascalified"
44+
Ex: `SDL_INIT_VIDEO` does not change into `SDLInitVideo`.
45+
46+
2. Names of function parameters shall not be modified or "pascalified"
47+
Ex.: `type_` in `function SDL_GetEventState(type_: TSDL_EventType): UInt8` does not change into 'evType`.
48+
49+
3. Use `UInt8`, `UInt16`, `UInt32`, `SInt8`, `SInt16`, `SInt32` and so on as often as possible.
50+
Do not use the Pascal equivalents.
51+
Ex.: Use `UInt32` instead of `Cardinal`, `LongWord` or `DWord`.
52+
3553
## Versions
3654

3755
The version tag (see [tags](https://github.com/PascalGameDevelopment/SDL2-for-Pascal/tags)) refers to the version of this translation package [SDL2 for Pascal](https://github.com/PascalGameDevelopment/SDL2-for-Pascal), not the `SDL2 library`.

0 commit comments

Comments
 (0)