Example #1
0
 /// <unmanaged>HRESULT IDirect3DDevice9::CreateTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DTexture9** ppTexture,[In] void** pSharedHandle)</unmanaged>
 private unsafe HRESULT CreateTexture_(int width, int height, int levels, D3DUSAGE usage, D3DFORMAT format, D3DPOOL pool, out IntPtr pTexture)
 {
     fixed(void *ppTexture = &pTexture)
     {
         //result = calli(System.Int32(System.Void*,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Void*,System.Void*), this._nativePointer, width, height, levels, usage, format, pool, &zero, (void*)sharedHandleRef, *(*(IntPtr*)this._nativePointer + (IntPtr)23 * (IntPtr)sizeof(void*)));
         return((HRESULT)NativeHelper.CalliInt32(23, _nativePointer, (int)width, (int)height, (int)levels, (int)usage, (int)format, (int)pool, (void *)ppTexture, (void *)IntPtr.Zero));
     }
 }
Example #2
0
        public Direct3DTexture9 CreateTexture(int width, int height, int levelCount, D3DUSAGE usage, D3DFORMAT format, D3DPOOL pool)
        {
            var nativePointer = IntPtr.Zero;
            var hr            = CreateTexture_(width, height, levelCount, usage, format, pool, out nativePointer);

            hr.CheckError();
            if (nativePointer == IntPtr.Zero)
            {
                return(null);
            }
            return(new Direct3DTexture9(nativePointer));
        }
Example #3
0
        /// <unmanaged>HRESULT IDirect3DDevice9::CreateVertexBuffer([In] unsigned int Length,[In] D3DUSAGE Usage,[In] D3DFVF FVF,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVertexBuffer9** ppVertexBuffer,[In] void** pSharedHandle)</unmanaged>
        public unsafe Direct3DVertexBuffer9 CreateVertexBuffer(int length, D3DUSAGE usage, D3DFVF vertexFormat, D3DPOOL pool)
        {
            var nativePointer = IntPtr.Zero;
            //result = calli(System.Int32(System.Void*,System.Int32,System.Int32,System.Int32,System.Int32,System.Void*,System.Void*), this._nativePointer, length, usage, vertexFormat, pool, &zero, (void*)sharedHandleRef, *(*(IntPtr*)this._nativePointer + (IntPtr)26 * (IntPtr)sizeof(void*)));
            var hr = (HRESULT)NativeHelper.CalliInt32(26, _nativePointer, (int)length, (int)usage, (int)vertexFormat, (int)pool, (void *)&nativePointer, (void *)IntPtr.Zero);

            hr.CheckError();
            if (nativePointer == IntPtr.Zero)
            {
                return(null);
            }
            return(new Direct3DVertexBuffer9(nativePointer));
        }
Example #4
0
        public unsafe static Direct3DTexture9 CreateTexture(Direct3DDevice9 device, int width, int height, int mipLevels, int usage, D3DFORMAT format, D3DPOOL pool)
        {
            var nativePointer = IntPtr.Zero;
            var hr            = (HRESULT)NativeMethods.D3DXCreateTexture_(
                (void *)((device == null) ? IntPtr.Zero : device.NativePointer),
                width, height, mipLevels,
                (int)usage, (int)format, (int)pool,
                (void *)&nativePointer);

            hr.CheckError();
            if (nativePointer == null)
            {
                return(null);
            }
            return(new Direct3DTexture9(nativePointer));
        }