Beispiel #1
0
 /// <unmanaged>HRESULT IDirect3DSwapChain9::GetBackBuffer([In] unsigned int iBackBuffer,[In] D3DBACKBUFFER_TYPE Type,[Out] IDirect3DSurface9** ppBackBuffer)</unmanaged>
 private unsafe HRESULT GetBackBuffer(int iBackBuffer, D3DBACKBUFFER_TYPE type, out IntPtr pBackBuffer)
 {
     fixed(void *ppBackBuffer = &pBackBuffer)
     {
         //result = calli(System.Int32(System.Void*,System.Int32,System.Int32,System.Void*), this._nativePointer, iBackBuffer, type, &zero, *(*(IntPtr*)this._nativePointer + (IntPtr)5 * (IntPtr)sizeof(void*)));
         return((HRESULT)NativeHelper.CalliInt32(5, _nativePointer, (int)iBackBuffer, (int)type, ppBackBuffer));
     }
 }
Beispiel #2
0
        public Direct3DSurface9 GetBackBuffer(int iBackBuffer, D3DBACKBUFFER_TYPE type)
        {
            var nativePointer = IntPtr.Zero;
            var hr            = GetBackBuffer(iBackBuffer, type, out nativePointer);

            hr.CheckError();
            if (nativePointer == IntPtr.Zero)
            {
                return(null);
            }
            return(new Direct3DSurface9(nativePointer));
        }