Ejemplo n.º 1
0
 internal IXAudio2(ProcessorSpecifier processorSpecifier, bool registerCallback)
     : base(XAudio2Native.XAudio2Create(0, processorSpecifier))
 {
     // Register engine callback
     if (registerCallback)
     {
         _engineCallback = new EngineCallbackImpl(this);
         RegisterForCallbacks(_engineCallback);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Create new instance of <see cref="IXAudio2"/> class.
        /// </summary>
        /// <param name="processorSpecifier"></param>
        /// <param name="registerCallback">Whether to register for callback, uses native RegisterForCallbacks.</param>
        public IXAudio2(
            ProcessorSpecifier processorSpecifier = ProcessorSpecifier.UseDefaultProcessor,
            bool registerCallback = true)
            : base(IntPtr.Zero)
        {
            NativePointer = XAudio2Native.XAudio2Create(0, processorSpecifier);

            // Register engine callback
            if (registerCallback)
            {
                _engineCallback = new EngineCallbackImpl(this);
                RegisterForCallbacks(_engineCallback);
            }
        }