hashlink icon indicating copy to clipboard operation
hashlink copied to clipboard

Improved documentation for embedding HL

Open Sunjammer opened this issue 7 years ago • 6 comments

This is very cool tech and the Embedding Hashlink wiki page needs a lot of love. "HashLink can be easily embedded into any application" is not really true when the knowledge needed to bootstrap it is distributed across a non-trivial C project with few if any comments.

Sunjammer avatar Oct 13 '18 11:10 Sunjammer

I'm not sure what there is to say more. You have a full 160 lines C code example (which is not much) available here:

https://github.com/HaxeFoundation/hashlink/blob/master/src/main.c

What else would be required ?

ncannasse avatar Oct 14 '18 08:10 ncannasse

it's seem there are no api about haxe in hl call native c api ?

sonygod avatar Dec 05 '18 08:12 sonygod

@sonygod no, you can't directly call C api for now

ncannasse avatar Dec 05 '18 08:12 ncannasse

@ncannasse because current I want to embed into Unity and call unity api in hl.

sonygod avatar Dec 05 '18 09:12 sonygod

@sonygod atm the best way is to write wrappers like we do for directx/sdl/etc.

ncannasse avatar Dec 05 '18 09:12 ncannasse

@ncannasse how to invoke hl static function from c++? can you give a small example?

I can't understand from here your description

class Main 
{
    
    static function main() 
    {
    
    
    }
    
    
    public static function start(){
        Debug.Log("hl realy startnow ");
    }
    
}

sonygod avatar Dec 06 '18 09:12 sonygod