COMMUNITY

Get started with SDL from Haxe?

I’d like to put together a little SDL hello-world app. Do I use HashLink for that, or are there some hxcpp libraries?

Anyone have some example code I can have a look at?

I’m on Debian GNU/Linux, with:

  • Haxe 4.0.0-rc.5
  • HashLink 1.10.0
  • libsdl2-dev
  • via haxelib install, the hlsdl library (currently at v1.10.0).

Is it common to directly use SDL from Haxe? I see that there are quite a few game frameworks available (though no idea if they use SDL under the hood).

Would be nice to find a Haxe solution similar to Python’s pygame, as I’m helping someone with a small pygame project and would like to mirror that project’s progress in my own project using Haxe. Any framework/lib recommendations?

Thanks so much!

As I’ve come to learn, right now SDL for HashLink is more of an ad-hoc implementation that fits Heaps’s needs but not much else. I suggest you rather look at linc-sdl, which is a complete Haxe binding of SDL for Haxe’s C++ target.

As for PyGame, I’m pretty sure there’s bindings for Haxe’s Python target.

2 Likes

Thanks very much, Mattias. Did not see linc-sdl at lib.haxe.org, but found it at github: https://github.com/snowkit/linc_sdl. Also the linc-sdl site.

On top of that, looks like there’s a handful of linc sdl tutorials on youtube.