Beispiel #1
0
        protected MFRect m_rcDestRect; // Destination rectangle.

        #endregion Fields

        #region Constructors

        public D3DPresentEngine()
        {
            m_iFrames = 0;
            m_hwnd = IntPtr.Zero;
            m_DeviceResetToken = 0;
            m_pD3D9 = null;
            m_pDevice = null;
            m_pDeviceManager = null;
            m_pSurfaceRepaint = null;

            m_rcDestRect = new MFRect();
            m_DisplayMode = new D3DDISPLAYMODE();

            InitializeD3D();

            CreateD3DDevice();
        }
        /// <summary>
        /// Part of the dispose pattern
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            //if (m_disposed) return;

            if (disposing)
            {
                InvokeNewSurfaceEvent(IntPtr.Zero);
                /* Pass a dummy cookie to TerminateDevice */
                TerminateDevice(IntPtr.Zero);

                if (m_allocatorNotify != null)
                {
                    Marshal.FinalReleaseComObject(m_allocatorNotify);
                    m_allocatorNotify = null;
                }

                if (m_d3d != null)
                {
                    Marshal.FinalReleaseComObject(m_d3d);
                    m_d3d = null;
                }

                if (m_d3dEx != null)
                {
                    Marshal.FinalReleaseComObject(m_d3dEx);
                    m_d3dEx = null;
                }

                if (m_device != null)
                {
                    Marshal.FinalReleaseComObject(m_device);
                    m_device = null;
                }
            }

            m_disposed = true;
        }
Beispiel #3
0
 public static extern int Direct3DCreate9Ex(ushort SDKVersion, [Out] out IDirect3D9Ex ex);
Beispiel #4
0
 public static Result Direct3DCreate9Ex(out IDirect3D9Ex result) => Direct3DCreate9Ex(SdkVersion, out result);
Beispiel #5
0
        public void Dispose()
        {
            GC.SuppressFinalize(this);

            SafeRelease(m_pDevice); m_pDevice = null;
            SafeRelease(m_pSurfaceRepaint); m_pSurfaceRepaint = null;
            SafeRelease(m_pDeviceManager); m_pDeviceManager = null;
            SafeRelease(m_pD3D9); m_pD3D9 = null;
        }
        /// <summary>
        /// Part of the dispose pattern
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            //if (m_disposed) return;

            if (disposing)
            {
                InvokeNewSurfaceEvent(IntPtr.Zero);
                /* Pass a dummy cookie to TerminateDevice */
                TerminateDevice(IntPtr.Zero);
               
                if (m_allocatorNotify != null)
                {
                    Marshal.FinalReleaseComObject(m_allocatorNotify);
                    m_allocatorNotify = null;
                }

                if (m_d3d != null)
                {
                    Marshal.FinalReleaseComObject(m_d3d);
                    m_d3d = null;
                }

                if (m_d3dEx != null)
                {
                    Marshal.FinalReleaseComObject(m_d3dEx);
                    m_d3dEx = null;
                }

                if (m_device != null)
                {
                    Marshal.FinalReleaseComObject(m_device);
                    m_device = null;
                }
            }

            m_disposed = true;
        }
Beispiel #7
0
 public extern static void Direct3DCreate9Ex(
     int SDKVersion,
     out IDirect3D9Ex pD3D
     );
Beispiel #8
0
 public static extern void Direct3DCreate9Ex(
     int SDKVersion,
     out IDirect3D9Ex pD3D
     );
Beispiel #9
0
 public static extern int Direct3DCreate9Ex(uint SDKVersion,
                                            [MarshalAs(UnmanagedType.Interface)] out IDirect3D9Ex d3d9ex);
Beispiel #10
0
 public static extern void Direct3DCreate9Ex([In] uint SDKVersion, [Out] out IDirect3D9Ex d3d);