Ejemplo n.º 1
0
        /// <summary>
        /// Registers the custom allocator and hooks into it's supplied events
        /// </summary>
        protected void RegisterCustomAllocator(ICustomAllocator allocator)
        {
            FreeCustomAllocator();

            if (allocator == null)
            {
                return;
            }

            m_customAllocator = allocator;

            m_customAllocator.NewAllocatorFrame   += CustomAllocatorNewAllocatorFrame;
            m_customAllocator.NewAllocatorSurface += CustomAllocatorNewAllocatorSurface;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Disposes of the current allocator
        /// </summary>
        protected void FreeCustomAllocator()
        {
            if (m_customAllocator == null)
            {
                return;
            }

            m_customAllocator.Dispose();

            m_customAllocator.NewAllocatorFrame   -= CustomAllocatorNewAllocatorFrame;
            m_customAllocator.NewAllocatorSurface -= CustomAllocatorNewAllocatorSurface;

            if (Marshal.IsComObject(m_customAllocator))
            {
                Marshal.ReleaseComObject(m_customAllocator);
            }

            m_customAllocator = null;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Registers the custom allocator and hooks into it's supplied events
        /// </summary>
        protected void RegisterCustomAllocator(ICustomAllocator allocator)
        {
            FreeCustomAllocator();

            if (allocator == null)
                return;

            m_customAllocator = allocator;

            m_customAllocator.NewAllocatorFrame += CustomAllocator_NewAllocatorFrame;
            m_customAllocator.NewAllocatorSurface += CustomAllocator_NewAllocatorSurface;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Disposes of the current allocator
        /// </summary>
        protected void FreeCustomAllocator()
        {
            if (m_customAllocator == null)
                return;

            m_customAllocator.NewAllocatorFrame -= CustomAllocator_NewAllocatorFrame;
            m_customAllocator.NewAllocatorSurface -= CustomAllocator_NewAllocatorSurface;

            m_customAllocator.Dispose();
            m_customAllocator = null;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Disposes of the current allocator
        /// </summary>
        protected void FreeCustomAllocator()
        {
            if (m_customAllocator == null)
                return;

            m_customAllocator.Dispose();

            m_customAllocator.NewAllocatorFrame -= CustomAllocatorNewAllocatorFrame;
            m_customAllocator.NewAllocatorSurface -= CustomAllocatorNewAllocatorSurface;

            if(Marshal.IsComObject(m_customAllocator))
                Marshal.ReleaseComObject(m_customAllocator);

            m_customAllocator = null;
        }