SDL2-for-Pascal
SDL2-for-Pascal copied to clipboard
ADD: Support for dynamic linking first version that can be compiled u…
Hello all,
based on the discussion https://github.com/ev1313/Pascal-SDL-2-Headers/issues/78#issuecomment-2480539141 i wrote a little FPC Transpiler and switched now my complete work over to this repository.
In Order to create the least impact possible, i choosed to do "inplace" modifications for the code switchings for dynamic / static linked version.
The static linked version is 99% unchanged (only needed to rename the two overloaded functions from sdl2.pas).
The dynamic linked version does compile under Windows64 and Linux64, under Linux64 i was also able to test the joystick part (and that worked ;) )
So if you choose to migrate this PR then all users who are using the SDL2.pas at least need to do this step:
(*
-
If you get a compiler error with missing file
-
just create a file namend "sdl2_cfg.inc" in your project folder and
-
insert the following content:
-
---------- Content of file --------- {*
-
set this define if you want to use dynamic linking instead of static linking
-
! Attention !
-
Not all functions are "ported" yet, see existing "working" code on how to
-
port missing functions. *} {.$DEFINE SDL_DYNAMIC_LINKING}
-
---------- End content of file ----------
-
! Attention !
-
If you use the dynamic link feature, don't forget to call the SDL_LoadLib
-
function. *)
And yes there is still plenty work to do, to have a fully supported dynamic linked SDL2.pas, but beside the already mentioned differences you could stay at the static linked version with nearly no change and at least the "basic" dynamic linked version does now exist ;).
I think if you merge this code base, maybe other interested users could finish the work i started here (y).