public static void InitTest()
        {
            Main.WinForm.Invoke(new Action(() =>
            {
                ERRCHECK(result = FMOD.Event_Factory.EventSystem_Create(ref _eventSystem));
                ERRCHECK(result = _eventSystem.init(MAX_CHANNELS, FMOD.INITFLAGS.NORMAL, (IntPtr)null, FMOD.EVENT_INITFLAGS.NORMAL));
                ERRCHECK(result = _eventSystem.getSystemObject(ref _system));

                DbgPrimCamPos          = new DebugPrimitives.DbgPrimWireArrow("FMOD Camera", Transform.Default, Color.Lime);
                DbgPrimCamPos.Category = DebugPrimitives.DbgPrimCategory.SoundEvent;
            }));
        }
示例#2
0
        public static void InitTest()
        {
            if (initialised)
            {
                return;
            }

            Main.WinForm.Invoke(new Action(() =>
            {
                if (eventSystemCreated)
                {
                    Shutdown();
                }

                result = FMOD.Event_Factory.EventSystem_Create(ref _eventSystem);

                if (result == RESULT.OK)
                {
                    eventSystemCreated = true;
                }
                else
                {
                    ERRCHECK(result);
                }

                result = _eventSystem.init(MAX_CHANNELS, FMOD.INITFLAGS.NORMAL, (IntPtr)null, FMOD.EVENT_INITFLAGS.NORMAL);
                if (result == RESULT.ERR_OUTPUT_INIT)
                {
                    DialogManager.DialogOK(null, "Failed to initialize FMOD audio output. " +
                                           "Make sure you have an audio device connected and working and " +
                                           "that no other app is taking exclusive control of the device.\n\n" +
                                           "Once you free the device, select FMOD Sound -> Retry Initialization");
                    initialised = false;
                }
                else if (result == RESULT.OK)
                {
                    initialised = true;
                }
                else
                {
                    ERRCHECK(result);
                }

                ERRCHECK(result = _eventSystem.getSystemObject(ref _system));

                DbgPrimCamPos          = new DebugPrimitives.DbgPrimWireArrow("FMOD Camera", Transform.Default, Color.Lime);
                DbgPrimCamPos.Category = DebugPrimitives.DbgPrimCategory.SoundEvent;
            }));
        }