@@ -47,9 +47,6 @@ public static T FromSwapChain<T>(SwapChain swapChain, int index) where T : Resou
4747/// <returns>The loaded texture object.</returns>
4848public static T FromFile < T > ( Device device , string fileName ) where T : Resource
4949{
50- System . Diagnostics . Debug . Assert ( typeof ( T ) == typeof ( Texture1D ) || typeof ( T ) == typeof ( Texture2D ) ||
51- typeof ( T ) == typeof ( Texture3D ) ) ;
52-
5350IntPtr temp ;
5451Result resultOut ;
5552D3DX10 . CreateTextureFromFile ( device , fileName , null , IntPtr . Zero , out temp , out resultOut ) ;
@@ -66,9 +63,6 @@ public static T FromFile<T>(Device device, string fileName) where T : Resource
6663/// <returns>The loaded texture object.</returns>
6764public static T FromFile < T > ( Device device , string fileName , ImageLoadInformation loadInfo ) where T : Resource
6865{
69- System . Diagnostics . Debug . Assert ( typeof ( T ) == typeof ( Texture1D ) || typeof ( T ) == typeof ( Texture2D ) ||
70- typeof ( T ) == typeof ( Texture3D ) ) ;
71-
7266IntPtr temp ;
7367Result resultOut ;
7468D3DX10 . CreateTextureFromFile ( device , fileName , loadInfo , IntPtr . Zero , out temp , out resultOut ) ;
@@ -84,13 +78,8 @@ public static T FromFile<T>(Device device, string fileName, ImageLoadInformation
8478/// <returns>The loaded texture object.</returns>
8579public static T FromMemory < T > ( Device device , byte [ ] memory ) where T : Resource
8680{
87- System . Diagnostics . Debug . Assert ( typeof ( T ) == typeof ( Texture1D ) || typeof ( T ) == typeof ( Texture2D ) ||
88- typeof ( T ) == typeof ( Texture3D ) ) ;
89-
9081 unsafe
9182{
92- System . Diagnostics . Debug . Assert ( memory != null ) ;
93- System . Diagnostics . Debug . Assert ( memory . Length > 0 ) ;
9483IntPtr temp ;
9584Result resultOut ;
9685 fixed( void * pBuffer = & memory [ 0 ] )
@@ -110,13 +99,8 @@ public static T FromMemory<T>(Device device, byte[] memory) where T : Resource
11099/// <returns>The loaded texture object.</returns>
111100public static T FromMemory < T > ( Device device , byte [ ] memory , ImageLoadInformation loadInfo ) where T : Resource
112101{
113- System . Diagnostics . Debug . Assert ( typeof ( T ) == typeof ( Texture1D ) || typeof ( T ) == typeof ( Texture2D ) ||
114- typeof ( T ) == typeof ( Texture3D ) ) ;
115-
116102 unsafe
117103{
118- System . Diagnostics . Debug . Assert ( memory != null ) ;
119- System . Diagnostics . Debug . Assert ( memory . Length > 0 ) ;
120104IntPtr temp ;
121105Result resultOut ;
122106 fixed( void * pBuffer = & memory [ 0 ] )
@@ -165,9 +149,6 @@ public static T FromStream<T>(Device device, Stream stream, int sizeInBytes, Ima
165149public static void ToFile < T > ( T texture , ImageFileFormat format , string fileName )
166150where T : Resource
167151{
168- System . Diagnostics . Debug . Assert ( typeof ( T ) == typeof ( Texture1D ) || typeof ( T ) == typeof ( Texture2D ) ||
169- typeof ( T ) == typeof ( Texture3D ) ) ;
170-
171152D3DX10 . SaveTextureToFile ( texture , format , fileName ) ;
172153}
173154
@@ -181,9 +162,6 @@ public static void ToFile<T>(T texture, ImageFileFormat format, string fileName)
181162public static void ToStream < T > ( T texture , ImageFileFormat format , Stream stream )
182163where T : Resource
183164{
184- System . Diagnostics . Debug . Assert ( typeof ( T ) == typeof ( Texture1D ) || typeof ( T ) == typeof ( Texture2D ) ||
185- typeof ( T ) == typeof ( Texture3D ) ) ;
186-
187165Blob blob ;
188166D3DX10 . SaveTextureToMemory ( texture , format , out blob , 0 ) ;
189167