示例#1
0
        public static IComObject <T> CreateTexture2D <T>(this ID3D11Device device, D3D11_TEXTURE2D_DESC desc, D3D11_SUBRESOURCE_DATA[] initialData = null) where T : ID3D11Texture2D
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            device.CreateTexture2D(ref desc, initialData, out var texture).ThrowOnError();
            return(new ComObject <T>((T)texture));
        }
示例#2
0
        public static ComObject <T> CreateTexture2D <T>(this ID3D11Device device, D3D11_TEXTURE2D_DESC desc) where T : ID3D11Texture2D
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            device.CreateTexture2D(ref desc, null, out var texture).ThrowOnError();
            return(new ComObject <T>((T)texture));
        }
示例#3
0
 public static ComObject <T> CreateTexture2D <T>(this ComObject <ID3D11Device> device, D3D11_TEXTURE2D_DESC desc) where T : ID3D11Texture2D => CreateTexture2D <T>(device?.Object, desc);
示例#4
0
 public static IComObject <T> CreateTexture2D <T>(this IComObject <ID3D11Device> device, D3D11_TEXTURE2D_DESC desc, D3D11_SUBRESOURCE_DATA[] initialData = null) where T : ID3D11Texture2D => CreateTexture2D <T>(device?.Object, desc, initialData);