Skip to content

Commit 2e1b141

Browse files
ADD: start adjusting code as requested by Free-Pascal-meets-SDL-Website
1 parent df74cd7 commit 2e1b141

File tree

1 file changed

+76
-47
lines changed

1 file changed

+76
-47
lines changed

units/sdl2.pas

Lines changed: 76 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -149,51 +149,8 @@ interface
149149
{$I ctypes.inc} // C data types
150150

151151
{SDL2 version of the represented header file}
152-
{$ifdef SDL_RUNTIME_LOADING}
153-
{$I runtime/sdlstdinc.inc}
154-
{$I runtime/sdlversion.inc} // 2.0.14
155-
{$I runtime/sdlerror.inc} // 2.0.14
156-
{$I runtime/sdlplatform.inc} // 2.0.14
157-
{$I runtime/sdlpower.inc} // 2.0.14
158-
{$I runtime/sdlthread.inc} // 2.30.2
159-
{$I runtime/sdlatomic.inc} // 2.0.20
160-
{$I runtime/sdlmutex.inc} // 2.26.5
161-
{$I runtime/sdltimer.inc} // 2.0.18
162-
{$I runtime/sdlpixels.inc} // 2.26.5
163-
{$I runtime/sdlrect.inc} // 2.24.0
164-
{$I runtime/sdlrwops.inc} // 2.0.14
165-
{$I runtime/sdlaudio.inc} // 2.26.3
166-
{$I runtime/sdlblendmode.inc} // 2.0.14
167-
{$I runtime/sdlsurface.inc} // 2.0.14
168-
{$I runtime/sdlvideo.inc} // 2.28.0
169-
{$I runtime/sdlshape.inc} // 2.24.0
170-
{$I runtime/sdlhints.inc} // 2.26.0
171-
{$I runtime/sdlloadso.inc} // 2.24.1
172-
{$I runtime/sdlmessagebox.inc} // 2.0.14
173-
{$I runtime/sdlrenderer.inc} // 2.0.22
174-
{$I runtime/sdlscancode.inc} // 2.26.2
175-
{$I runtime/sdlkeycode.inc} // 2.26.2
176-
{$I runtime/sdlkeyboard.inc} // 2.24.1
177-
{$I runtime/sdlmouse.inc} // 2.0.24
178-
{$I runtime/sdlguid.inc} // 2.24.0
179-
{$I runtime/sdljoystick.inc} // 2.24.0
180-
{$I runtime/sdlsensor.inc} // 2.26.0
181-
{$I runtime/sdlgamecontroller.inc} // 2.30.0
182-
{$I runtime/sdlhaptic.inc} // 2.26.2
183-
{$I runtime/sdlhidapi.inc} // 2.0.18
184-
{$I runtime/sdltouch.inc} // 2.24.0
185-
{$I runtime/sdlgesture.inc} // 2.26.2
186-
{$I runtime/sdlsyswm.inc} // 2.26.5
187-
{$I runtime/sdlevents.inc} // 2.24.0
188-
{$I runtime/sdllocale.inc} // 2.0.14
189-
{$I runtime/sdlclipboard.inc} // 2.24.1
190-
{$I runtime/sdlcpuinfo.inc} // 2.0.14
191-
{$I runtime/sdlfilesystem.inc} // 2.24.1
192-
{$I runtime/sdllog.inc} // 2.0.14
193-
{$I runtime/sdlmisc.inc} // 2.0.14
194-
{$I runtime/sdlsystem.inc} // 2.24.0
195-
{$I runtime/sdl.inc} // 2.0.14
196-
{$else}
152+
{$ifndef SDL_RUNTIME_LOADING}
153+
197154
{$I sdlstdinc.inc}
198155
{$I sdlversion.inc} // 2.0.14
199156
{$I sdlerror.inc} // 2.0.14
@@ -237,11 +194,83 @@ interface
237194
{$I sdlmisc.inc} // 2.0.14
238195
{$I sdlsystem.inc} // 2.24.0
239196
{$I sdl.inc} // 2.0.14
197+
198+
{$else}
199+
200+
{$I runtime/sdlstdinc.inc}
201+
{$I runtime/sdlversion.inc} // 2.0.14
202+
{$I runtime/sdlerror.inc} // 2.0.14
203+
{$I runtime/sdlplatform.inc} // 2.0.14
204+
{$I runtime/sdlpower.inc} // 2.0.14
205+
{$I runtime/sdlthread.inc} // 2.30.2
206+
{$I runtime/sdlatomic.inc} // 2.0.20
207+
{$I runtime/sdlmutex.inc} // 2.26.5
208+
{$I runtime/sdltimer.inc} // 2.0.18
209+
{$I runtime/sdlpixels.inc} // 2.26.5
210+
{$I runtime/sdlrect.inc} // 2.24.0
211+
{$I runtime/sdlrwops.inc} // 2.0.14
212+
{$I runtime/sdlaudio.inc} // 2.26.3
213+
{$I runtime/sdlblendmode.inc} // 2.0.14
214+
{$I runtime/sdlsurface.inc} // 2.0.14
215+
{$I runtime/sdlvideo.inc} // 2.28.0
216+
{$I runtime/sdlshape.inc} // 2.24.0
217+
{$I runtime/sdlhints.inc} // 2.26.0
218+
{$I runtime/sdlloadso.inc} // 2.24.1
219+
{$I runtime/sdlmessagebox.inc} // 2.0.14
220+
{$I runtime/sdlrenderer.inc} // 2.0.22
221+
{$I runtime/sdlscancode.inc} // 2.26.2
222+
{$I runtime/sdlkeycode.inc} // 2.26.2
223+
{$I runtime/sdlkeyboard.inc} // 2.24.1
224+
{$I runtime/sdlmouse.inc} // 2.0.24
225+
{$I runtime/sdlguid.inc} // 2.24.0
226+
{$I runtime/sdljoystick.inc} // 2.24.0
227+
{$I runtime/sdlsensor.inc} // 2.26.0
228+
{$I runtime/sdlgamecontroller.inc} // 2.30.0
229+
{$I runtime/sdlhaptic.inc} // 2.26.2
230+
{$I runtime/sdlhidapi.inc} // 2.0.18
231+
{$I runtime/sdltouch.inc} // 2.24.0
232+
{$I runtime/sdlgesture.inc} // 2.26.2
233+
{$I runtime/sdlsyswm.inc} // 2.26.5
234+
{$I runtime/sdlevents.inc} // 2.24.0
235+
{$I runtime/sdllocale.inc} // 2.0.14
236+
{$I runtime/sdlclipboard.inc} // 2.24.1
237+
{$I runtime/sdlcpuinfo.inc} // 2.0.14
238+
{$I runtime/sdlfilesystem.inc} // 2.24.1
239+
{$I runtime/sdllog.inc} // 2.0.14
240+
{$I runtime/sdlmisc.inc} // 2.0.14
241+
{$I runtime/sdlsystem.inc} // 2.24.0
242+
{$I runtime/sdl.inc} // 2.0.14
243+
240244
{$endif}
241245

242246
{$ifdef SDL_RUNTIME_LOADING}
243-
Function SDL_LoadLib(LibFilename: String): Boolean;
244-
Procedure SDL_UnLoadLib();
247+
248+
// Loads the SDL library dynamically at runtime.
249+
//
250+
// Note:
251+
// This is NOT a native SDL function. It is part of this binding layer
252+
// to support runtime (dynamic) loading of the SDL library.
253+
//
254+
// Parameters:
255+
// LibFilename:
256+
// Path or filename of the SDL shared library to load.
257+
// If an empty string is provided, the default library name
258+
// (SDL_LibName) will be used.
259+
//
260+
// Returns:
261+
// True if the library was successfully loaded, False otherwise.
262+
function SDL_LoadLib(LibFilename: string): Boolean;
263+
264+
// Unloads the previously loaded SDL library.
265+
//
266+
// Note:
267+
// This is NOT a native SDL function. It is part of this binding layer
268+
// and complements SDL_LoadLib for runtime unloading.
269+
//
270+
// After calling this function, all dynamically loaded SDL function
271+
// pointers become invalid.
272+
procedure SDL_UnLoadLib();
273+
245274
{$endif}
246275

247276
implementation

0 commit comments

Comments
 (0)