|
| 1 | +# SDL3-for-Pascal H2Paswizard Tool |
| 2 | + |
| 3 | +This file describes how to use the |
| 4 | +[H2Paswizard tool](https://wiki.freepascal.org/H2Paswizard) |
| 5 | +to translate SDL3 header files into Pascal units for the |
| 6 | +[SDL3 for Pascal Project](https://github.com/PascalGameDevelopment/SDL3-for-Pascal). |
| 7 | +[H2Pas](https://wiki.freepascal.org/H2Pas) is a command line tool to translate |
| 8 | +C header files into Pascal units. H2Paswizard is a GUI for easier use of H2Pas. |
| 9 | + |
| 10 | +H2Paswizard is shipped as package alongside with the Lazarus IDE but is not |
| 11 | +installed. The file `translate-sdl3-h2paswizard.h2p` is specifically created by |
| 12 | +us to translate SDL3 header files into Pascal units as required for |
| 13 | +SDL3-for-Pascal. |
| 14 | + |
| 15 | +## How to start |
| 16 | + |
| 17 | +- [Install the H2Paswizard package](https://wiki.lazarus.freepascal.org/Install_Packages) |
| 18 | +to the Lazarus IDE |
| 19 | +- Start H2Paswizard: Select menu item Tools -> H2Pas... |
| 20 | +- Click on "Add .h files..."-button and add `sdl3code.h` (from SDL3-for-Pascal |
| 21 | +tools/h2paswizard folder) |
| 22 | +- Click on "Open Settings"-button and open `translate-sdl3-h2paswizard.h2p` |
| 23 | +- Open "H2Pas Options"-tab; activate the following options: -e, -i, -D, -c, -p, -T, -C |
| 24 | +- Further options: -l Library name: "SDL3" |
| 25 | +- Output extension: ".inc" |
| 26 | +- Output directory: e.g. SDL3-for-Pascal/tools/h2paswizard/ |
| 27 | +- Open `sdl3code.h` and `sdl3code.inc` in Lazarus |
| 28 | +- Now you are ready to copy C code into `sdl3code.h` and get the resulting Pascal |
| 29 | +code in `sdl3code.inc` by hitting "Run H2Pas" |
| 30 | + |
| 31 | +*Hint:* You should open the settings always again, if you closed H2Paswizard. |
| 32 | +Otherwise the settings file is not recognized. |
| 33 | + |
| 34 | +*Important:* The results are not perfect, they must always be revised. |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
0 commit comments