pub trait NativeVM: 'static + Sync + Send {
    // Required methods
    fn dll_entry(syscall: Syscall) -> Box<Self>
       where Self: Sized;
    fn vm_main(
        &self,
        command: c_int,
        arg0: c_int,
        arg1: c_int,
        arg2: c_int,
        arg3: c_int,
        arg4: c_int,
        arg5: c_int,
        arg6: c_int,
        arg7: c_int,
        arg8: c_int,
        arg9: c_int,
        arg10: c_int,
        arg11: c_int
    ) -> intptr_t;
}
Expand description

Raw FFI interface for shared library modules

To use an implementation of this, it needs to be wrapped into a shared library with native_vm!.

Required Methods§

source

fn dll_entry(syscall: Syscall) -> Box<Self>where Self: Sized,

Initialization function

syscall is a generic callback into the engine for this module.

See Sys_LoadGameDll in ioquake3’s sys/sys_main.c.

source

fn vm_main( &self, command: c_int, arg0: c_int, arg1: c_int, arg2: c_int, arg3: c_int, arg4: c_int, arg5: c_int, arg6: c_int, arg7: c_int, arg8: c_int, arg9: c_int, arg10: c_int, arg11: c_int ) -> intptr_t

Module dispatcher function

Engine calls this for module logic, e.g. GAME_INIT.

See VM_Call in ioquake3’s qcommon/vm.c. See vm_s.entryPoint in ioquake3’s qcommon/vm_local.h.

Implementors§