07-26-2021, 04:56 PM
I see you really understand how to handle pixels properly, glad to know! But having seen the same mistakes you talk about in released games, I had to mention it.
I've done a bit of research about Kha. It is a complete multimedia framework -not a library- that sits on top of Haxe, an ECMAScript-based language that outputs source code for several other languages. This architecture is very different from SDL, that is a cross-platform native system library that provides basic windowing and multimedia features, with bindings for other languages and environments.
Can be Tilengine mixed with Kha? It depends on Haxe -I haven't researched this topic quite enough-. Haxe compiler outputs source code, not native binary code, so it cannot use bindings to existing binaries the way C#, Java, Python or Freebasic do. Or in the best case scenario, its support would be limited to platforms where Tilengine has already been ported and has a native library available. Understanding that the aim of Haxe is generating code for as much platforms as possible from a single codebase, this approach would be of no use.
Feasible approach would be mixing C and haxe modules at the source level, before generating final output. Emscripten compiler does this for C and javascript, and in fact I'm using it to bring HTML5 support for Tilengine. With this it will run inside a web browser, as either a javascript source library or web-assembly final executable. Tilengine itself is very portable, depending only on basic C stdlib, libpng, and SDL2 for windowing subsystem. And even this one is contained on a single module, isolated from the main engine, so it can be easily removed and replaced with whatever rendering mechanism the host provides. The Java binding and libretro core port don't use SDL at all.
But I'm afraid that in Haxe, the source is always the .hx file, and everything originates from here, not the other way around. However if there's a tool to translate/compile from C to haxe -something like "Emscripten for haxe"-, then they could be interoperated.
For the ongoing HTML5 research, it is interesting because it will bring support for web browsers, but also for mobile platforms via hybrid application, as there are frameworks like Electron that take a client web codebase (HTML5/css/js) and output mobile apps.
I've done a bit of research about Kha. It is a complete multimedia framework -not a library- that sits on top of Haxe, an ECMAScript-based language that outputs source code for several other languages. This architecture is very different from SDL, that is a cross-platform native system library that provides basic windowing and multimedia features, with bindings for other languages and environments.
Can be Tilengine mixed with Kha? It depends on Haxe -I haven't researched this topic quite enough-. Haxe compiler outputs source code, not native binary code, so it cannot use bindings to existing binaries the way C#, Java, Python or Freebasic do. Or in the best case scenario, its support would be limited to platforms where Tilengine has already been ported and has a native library available. Understanding that the aim of Haxe is generating code for as much platforms as possible from a single codebase, this approach would be of no use.
Feasible approach would be mixing C and haxe modules at the source level, before generating final output. Emscripten compiler does this for C and javascript, and in fact I'm using it to bring HTML5 support for Tilengine. With this it will run inside a web browser, as either a javascript source library or web-assembly final executable. Tilengine itself is very portable, depending only on basic C stdlib, libpng, and SDL2 for windowing subsystem. And even this one is contained on a single module, isolated from the main engine, so it can be easily removed and replaced with whatever rendering mechanism the host provides. The Java binding and libretro core port don't use SDL at all.
But I'm afraid that in Haxe, the source is always the .hx file, and everything originates from here, not the other way around. However if there's a tool to translate/compile from C to haxe -something like "Emscripten for haxe"-, then they could be interoperated.
For the ongoing HTML5 research, it is interesting because it will bring support for web browsers, but also for mobile platforms via hybrid application, as there are frameworks like Electron that take a client web codebase (HTML5/css/js) and output mobile apps.