public GameEngine(IMessagePropagator messagePropagator)
        {
            _messagePropagator = messagePropagator;

            IntPtr external_window = EngineInterop.externalwindow_create();

            EngineInterop.ExternalWindowDeliverFn deliverFn = new EngineInterop.ExternalWindowDeliverFn(recieve_msg);
            EngineInterop.externalwindow_set_deliver_fn(external_window, Marshal.GetFunctionPointerForDelegate(deliverFn));

            EngineInterop.ExternalWindowReceiveFn receiveFn = new EngineInterop.ExternalWindowReceiveFn(send_msg);
            EngineInterop.externalwindow_set_receive_fn(external_window, Marshal.GetFunctionPointerForDelegate(receiveFn));

            EngineInterop.ExternalWindowUpdateFn updateFn = new EngineInterop.ExternalWindowUpdateFn(update);
            EngineInterop.externalwindow_set_update_fn(external_window, Marshal.GetFunctionPointerForDelegate(updateFn));

            IntPtr creation_info = EngineInterop.gameenginecreationinfo_create();

            EngineInterop.gameenginecreationinfo_set_externalwindow(creation_info, external_window);

            _engineInstance = EngineInterop.gameengine_create(creation_info);

            _messagePropagator.GetMessage <SendRawMsg>().Subscribe(OnSendRawMsgMessage, ThreadHandler.Default);
        }
 public void Run()
 {
     EngineInterop.gameengine_run(_engineInstance);
 }