Example #1
0
        public Core(string args, EventHandler eventHandler)
        {
            this.eventHandler = eventHandler;

            #if STATIC_BIND
            this.coreHandler = Native.space_domain_init_context(args);
            #else
            var libName  = "libffi_space.so";
            var dataPath = Application.dataPath + "/Plugins/" + libName;
            libraryHandle = LoadLibrary(dataPath);

            // load methods
            this.nativeContextClose = GetLibraryFunction <ContextClose>(libraryHandle, "space_domain_close_context");
            this.nativeContextPush  = GetLibraryFunction <ContextPush>(libraryHandle, "space_domain_set_data");
            this.nativeContextTake  = GetLibraryFunction <ContextTake>(libraryHandle, "space_domain_get_data");
            this.nativeContextTick  = GetLibraryFunction <ContextTick>(libraryHandle, "space_domain_run_tick");

            // start ffi context
            CreateContext createContext = GetLibraryFunction <CreateContext>(libraryHandle, "space_domain_init_context");
            contextHandle = createContext.Invoke(args);
            #endif
            Debug.Log("core initialize");
        }
Example #2
0
 internal static extern UInt32 space_domain_get_data(CoreHandler ptr, Action <UInt16, IntPtr, UInt32> callback);
Example #3
0
 internal static extern UInt32 space_domain_set_data(CoreHandler ptr, UInt16 kind, byte[] buffer, UInt32 len);
Example #4
0
 internal static extern UInt32 space_domain_run_tick(CoreHandler ptr, UInt32 delta);