HashLink is a virtual machine for the Haxe programming language. By targeting HashLink you are also able to generate Native C code for your project.
A step by step guide can be found in [[Hello-HashLink]].
HashLink is able to support both SDL and DirectX. At least one and only one is required. OpenAL provides using sound.
For SDL
-lib hlsdlFor DirectX (Windows)
-lib hldxOpenAL (for sound)
-lib hlopenalMore available libraries can be found here.
To compile for HashLink use the following example.
# class paths
-cp src
# entry point
-main Main
# libraries
-lib heaps
-lib hlsdl
#-lib hldx
# output
-hl bin/game.hlHot reload allows to program new features into a game while it is running.
Use the following flag to allow that Hot Reload is being used.
-D hot-reload
Now run your HashLink program with
hl --hot-reload mygame.hl
Now everytime you re-compile, the running game also gets updated.
Note that this has its limits and this feature is still under development and being tested. Currently no new fields can be implemented. However it works well for modifying the behaviour of an already existing method (class function), for instance the update method and all other functions called inside it.
(See details here: https://github.com/HaxeFoundation/hashlink/wiki/Hot-Reload)