internal Generator(Context context, IntPtr pNode, bool addRef) : base(context, pNode, addRef) { this.generationRunningChanged = new StateChangedEvent(this, SafeNativeMethods.xnRegisterToGenerationRunningChange, SafeNativeMethods.xnUnregisterFromGenerationRunningChange); this.newDataAvailable = new StateChangedEvent(this, SafeNativeMethods.xnRegisterToNewDataAvailable, SafeNativeMethods.xnUnregisterFromNewDataAvailable); if(IsCapabilitySupported(Capabilities.AlternativeViewPoint)) m_alternativeViewpointCapability = new AlternativeViewpointCapability(this); else m_alternativeViewpointCapability = null; if(IsCapabilitySupported(Capabilities.FrameSync)) m_frameSyncCapability = new FrameSyncCapability(this); else m_frameSyncCapability = null; if (IsCapabilitySupported(Capabilities.Mirror)) m_mirrorCapability = new MirrorCapability(this); else m_mirrorCapability = null; }
internal Generator(Context context, IntPtr pNode, bool addRef) : base(context, pNode, addRef) { this.generationRunningChanged = new StateChangedEvent(this, SafeNativeMethods.xnRegisterToGenerationRunningChange, SafeNativeMethods.xnUnregisterFromGenerationRunningChange); this.newDataAvailable = new StateChangedEvent(this, SafeNativeMethods.xnRegisterToNewDataAvailable, SafeNativeMethods.xnUnregisterFromNewDataAvailable); if (IsCapabilitySupported(Capabilities.AlternativeViewPoint)) { m_alternativeViewpointCapability = new AlternativeViewpointCapability(this); } else { m_alternativeViewpointCapability = null; } if (IsCapabilitySupported(Capabilities.FrameSync)) { m_frameSyncCapability = new FrameSyncCapability(this); } else { m_frameSyncCapability = null; } if (IsCapabilitySupported(Capabilities.Mirror)) { m_mirrorCapability = new MirrorCapability(this); } else { m_mirrorCapability = null; } }
/// @todo this is a temporary solution for capability not being disposed by anyone external public override void Dispose() { if (m_alternativeViewpointCapability != null) { m_alternativeViewpointCapability.InternalDispose(); m_alternativeViewpointCapability = null; } if (m_frameSyncCapability != null) { m_frameSyncCapability.InternalDispose(); m_frameSyncCapability = null; } if (m_mirrorCapability != null) { m_mirrorCapability.InternalDispose(); m_mirrorCapability = null; } base.Dispose(); }