Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 773 Bytes

INTEROP.md

File metadata and controls

22 lines (18 loc) · 773 Bytes

Interoperation

The GUI interoperates with the simulation backend by calling predefined library functions.

Simulation

The simulation backend has a macro definition ffi in ffi.rs which tells the compiler to use the C calling convention and to not mangle the function name.

GUI

The function is then defined in the Interop/Logic.cs file.

Add the following two lines in the Logic class.

[DllImport(Lib, EntryPoint = "<sim_name>", ExactSpelling = true, CallingConvention = CallingConv)]
public static extern void <gui_name>();

<sim_name> is the name as defined in the simulation code and <gui_name> is the name of the function as it should be used in the GUI program.