{"repo":"haxiomic/haxe-c-bridge","free":true,"listed":false,"github":"https://github.com/haxiomic/haxe-c-bridge","clone":"git clone https://github.com/haxiomic/haxe-c-bridge.git","description":"Easily interact with haxe classes from C with an automatically generated C header","language":"Haxe","stars":61,"topics":["haxe","c","cross-platform","interop","ios","android","embed","exposed-functions","hxcpp","haxe-thread"],"license":"MIT","category":"mobile-apps","readme_excerpt":"Haxe C Bridge HaxeCBridge is a @:build macro that enables calling haxe code from C by exposing classes via an automatically generated C header. This makes it possible to build your user interfaces using native platform tools (like Swift and Java) and call into haxe code for the main app work like rendering Requires haxe 4.0 or newer and hxcpp Quick Start Install with haxelib install haxe-c-bridge (or simply copy the HaxeCBridge.hx file into your root class-path) Haxe-side: - Add --library haxe-c-bridge to your hxml - Add -D dll link or -D static link to your hxml to compile your haxe program into a native library binary - Add @:build(HaxeCBridge.expose()) to classes that you want to expose to C (you can add this to as many classes as you like – all functions are combined into a single header file) - HaxeCBridge will then generate a header file in your build output directory named after your --main class (however a --main class is not required to use HaxeCBridge) C-side: - #include the generated header and link with the hxcpp generated library binary - Before calling any haxe functions you must start the haxe thread: call YourLibName initializeHaxeThread(onHaxeException) - Now interact with your haxe library thread by calling the exposed functions - When your program exits call YourLibName stopHaxeThread(true) See test/unit for a complete example Minimal Example Main.hx build.hxml Then run haxe build.hxml to compile the haxe code into a native library binary This will generate","default_branch":null,"files":null,"tree":[],"storefront":"/r/haxiomic","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/haxiomic/haxe-c-bridge/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}