Ejemplo n.º 1
0
        public virtual int GetDisplaySurfaceData(
            IDXGISurface pDestination
            )
        {
            var fp = GetFunctionPointer(17);

            if (m_GetDisplaySurfaceDataFunc == null)
            {
                m_GetDisplaySurfaceDataFunc = (GetDisplaySurfaceDataFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(GetDisplaySurfaceDataFunc));
            }

            return(m_GetDisplaySurfaceDataFunc(m_ptr, pDestination != null ? pDestination.Ptr : IntPtr.Zero));
        }
Ejemplo n.º 2
0
        public virtual int GetSurface(
            out IDXGISurface dxgiSurface
            )
        {
            var fp = GetFunctionPointer(13);

            if (m_GetSurfaceFunc == null)
            {
                m_GetSurfaceFunc = (GetSurfaceFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(GetSurfaceFunc));
            }
            dxgiSurface = new IDXGISurface();
            return(m_GetSurfaceFunc(m_ptr, out dxgiSurface.PtrForNew));
        }
Ejemplo n.º 3
0
        public virtual int SetDisplaySurface(
            IDXGISurface pScanoutSurface
            )
        {
            var fp = GetFunctionPointer(16);

            if (m_SetDisplaySurfaceFunc == null)
            {
                m_SetDisplaySurfaceFunc = (SetDisplaySurfaceFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(SetDisplaySurfaceFunc));
            }

            return(m_SetDisplaySurfaceFunc(m_ptr, pScanoutSurface != null ? pScanoutSurface.Ptr : IntPtr.Zero));
        }
Ejemplo n.º 4
0
        public virtual int CreateBitmapFromDxgiSurface(
            IDXGISurface surface,
            ref D2D1_BITMAP_PROPERTIES1 bitmapProperties,
            out ID2D1Bitmap1 bitmap
            )
        {
            var fp = GetFunctionPointer(62);

            if (m_CreateBitmapFromDxgiSurfaceFunc == null)
            {
                m_CreateBitmapFromDxgiSurfaceFunc = (CreateBitmapFromDxgiSurfaceFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateBitmapFromDxgiSurfaceFunc));
            }
            bitmap = new ID2D1Bitmap1();
            return(m_CreateBitmapFromDxgiSurfaceFunc(m_ptr, surface != null ? surface.Ptr : IntPtr.Zero, ref bitmapProperties, out bitmap.PtrForNew));
        }
Ejemplo n.º 5
0
        public virtual int CreateDxgiSurfaceRenderTarget(
            IDXGISurface dxgiSurface,
            ref D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties,
            out ID2D1RenderTarget renderTarget
            )
        {
            var fp = GetFunctionPointer(15);

            if (m_CreateDxgiSurfaceRenderTargetFunc == null)
            {
                m_CreateDxgiSurfaceRenderTargetFunc = (CreateDxgiSurfaceRenderTargetFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateDxgiSurfaceRenderTargetFunc));
            }
            renderTarget = new ID2D1RenderTarget();
            return(m_CreateDxgiSurfaceRenderTargetFunc(m_ptr, dxgiSurface != null ? dxgiSurface.Ptr : IntPtr.Zero, ref renderTargetProperties, out renderTarget.PtrForNew));
        }
Ejemplo n.º 6
0
        public virtual int CreateSurface(
            ref DXGI_SURFACE_DESC pDesc,
            uint NumSurfaces,
            uint Usage,
            ref DXGI_SHARED_RESOURCE pSharedResource,
            out IDXGISurface ppSurface
            )
        {
            var fp = GetFunctionPointer(8);

            if (m_CreateSurfaceFunc == null)
            {
                m_CreateSurfaceFunc = (CreateSurfaceFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateSurfaceFunc));
            }
            ppSurface = new IDXGISurface();
            return(m_CreateSurfaceFunc(m_ptr, ref pDesc, NumSurfaces, Usage, ref pSharedResource, out ppSurface.PtrForNew));
        }
Ejemplo n.º 7
0
 public static extern int D2D1CreateDeviceContext(
     IDXGISurface dxgiSurface,
     ref D2D1_CREATION_PROPERTIES creationProperties,
     [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CustomMarshaler <ID2D1DeviceContext>))] out ID2D1DeviceContext d2dDeviceContext
     );