File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change 116116### Opaque Structs
117117
118118If you have something like ``` typedef struct name name ``` . the concrete
119- structure is opaque. See issue
120- [ #63 ] ( https://github.com/PascalGameDevelopment/SDL2-for-Pascal/issues/63 ) )
121- for details.
119+ structure is opaque, and the programmer is expected to only ever
120+ interact with pointers to the struct.
122121
123122C:
124123
@@ -128,21 +127,17 @@ typedef struct SDL_Window SDL_Window;
128127
129128Pascal:
130129
131- Prefered:
132130``` pascal
133131type
134132 PPSDL_Window = ^PSDL_Window;
135- PSDL_Window = ^TSDL_Window;
136- TSDL_Window = type Pointer;
133+ PSDL_Window = type Pointer;
137134```
138135
139- Alternativly:
140- ``` pascal
141- type
142- PPSDL_Window = ^PSDL_Window;
143- PSDL_Window = ^TSDL_Window;
144- TSDL_Window = record end;
145- ```
136+ As shown above, for opaque structs, we avoid defining the base ` TType `
137+ and define only the pointer ` PType ` .
138+ For the rationale behind this decision, read the discussion in
139+ [ issue #63 ] ( https://github.com/PascalGameDevelopment/SDL2-for-Pascal/issues/63 ) .
140+
146141
147142## Unions
148143
You can’t perform that action at this time.
0 commit comments