2 * Copyright (C) 2009 Tony Wasserka
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "wine/debug.h"
21 #include "wine/unicode.h"
22 #include "d3dx9_36_private.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(d3dx
);
26 /************************************************************
29 * Generates a mipmap chain from a given mipmap level of a texture using
30 * the various filters described by the D3DX_FILTER flags.
33 * pTexture [I] pointer to the texture
34 * pPalette [I] palette to use
35 * SrcLevel [I] base source level
36 * dwFilter [I] filter to apply
40 * Failure: D3DXERR_INVALIDDATA, if pTexture is not lockable
41 * D3DERR_INVALIDCALL, if the parameters are invalid
44 * passing D3DX_DEFAULT for SrcLevel equals passing 0
45 * passing D3DX_DEFAULT for dwFilter equals passing D3DX_FILTER_BOX
46 * If the texture size is not a power of two, dithering will be used then additionally.
48 HRESULT WINAPI
D3DXFilterTexture(LPDIRECT3DBASETEXTURE9 pTexture
,
49 CONST PALETTEENTRY
*pPalette
,
53 UINT Level
= SrcLevel
+ 1;
57 if( !pTexture
) return D3DERR_INVALIDCALL
;
58 if( (dwFilter
& 0xFFFF) > D3DX_FILTER_BOX
&& dwFilter
!= D3DX_DEFAULT
) return D3DERR_INVALIDCALL
;
59 if(SrcLevel
>= IDirect3DBaseTexture9_GetLevelCount(pTexture
)) return D3DERR_INVALIDCALL
;
61 switch(IDirect3DBaseTexture9_GetType(pTexture
)) {
62 case D3DRTYPE_TEXTURE
:
64 IDirect3DSurface9
*pTopSurf
, *pMipSurf
;
67 if(dwFilter
== D3DX_DEFAULT
) {
68 IDirect3DTexture9_GetLevelDesc((IDirect3DTexture9
*)pTexture
, SrcLevel
, &Desc
);
69 if( is_pow2(Desc
.Width
) && is_pow2(Desc
.Height
) ) dwFilter
= D3DX_FILTER_BOX
;
70 else dwFilter
= D3DX_FILTER_BOX
| D3DX_FILTER_DITHER
;
73 hr
= IDirect3DTexture9_GetSurfaceLevel((IDirect3DTexture9
*)pTexture
, SrcLevel
, &pTopSurf
);
74 if(FAILED(hr
)) return D3DERR_INVALIDCALL
;
76 while(IDirect3DTexture9_GetSurfaceLevel((IDirect3DTexture9
*)pTexture
, Level
, &pMipSurf
) == D3D_OK
) {
77 hr
= D3DXLoadSurfaceFromSurface(pMipSurf
, pPalette
, NULL
, pTopSurf
, pPalette
, NULL
, dwFilter
, 0);
78 IDirect3DSurface9_Release(pMipSurf
);
82 IDirect3DSurface9_Release(pTopSurf
);
83 if(Level
== SrcLevel
+ 1) return D3DERR_INVALIDCALL
;
88 FIXME("Implement volume and cube texture filtering\n");
93 /************************************************************
94 * D3DXCheckTextureRequirements
96 * Modifies input parameters so that they're supported by the device.
97 * If a parameter is NULL it is ignored.
100 * pDevice [I ] device which will create the texture
101 * pWidth [IO] width of the texture
102 * pHeight [IO] height of the texture
103 * pMipLevels [IO] number of miplevels to use for the texture
104 * dwUsage [I ] usage of the texture
105 * pFormat [IO] format of the texture
106 * Pool [I ] pool of the texture
110 * Failure: D3DERR_INVALIDCALL, if there's no way to create a supported texture or
111 * if pDevice, dwUsage or Pool have invalid values
114 * If any of the pointer values (except pDevice) is NULL, it will be ignored
117 HRESULT WINAPI
D3DXCheckTextureRequirements(LPDIRECT3DDEVICE9 pDevice
,
128 if( !pDevice
) return D3DERR_INVALIDCALL
;
131 if(dwUsage
!= D3DX_DEFAULT
&& dwUsage
& (D3DUSAGE_WRITEONLY
| D3DUSAGE_DONOTCLIP
| D3DUSAGE_POINTS
| D3DUSAGE_RTPATCHES
| D3DUSAGE_NPATCHES
))
132 return D3DERR_INVALIDCALL
;
136 if (Pool
!= D3DPOOL_DEFAULT
&& Pool
!= D3DPOOL_MANAGED
&& Pool
!= D3DPOOL_SYSTEMMEM
&& Pool
!= D3DPOOL_SCRATCH
)
137 return D3DERR_INVALIDCALL
;
140 /* width and height */
141 IDirect3DDevice9_GetDeviceCaps(pDevice
, &Caps
);
142 if(pWidth
&& pHeight
) {
143 if(*pWidth
== D3DX_DEFAULT
&& *pHeight
== D3DX_DEFAULT
) *pWidth
= *pHeight
= 256;
144 else if(*pWidth
== D3DX_DEFAULT
) *pWidth
= *pHeight
;
145 else if(*pHeight
== D3DX_DEFAULT
) *pHeight
= *pWidth
;
147 if(*pWidth
== 0) *pWidth
= 1;
148 if(*pHeight
== 0) *pHeight
= 1;
150 if(*pWidth
== D3DX_DEFAULT
) *pWidth
= 256;
151 else if(*pWidth
== 0) *pWidth
= 1;
153 if(*pHeight
== D3DX_DEFAULT
) *pHeight
= 256;
154 else if(*pHeight
== 0) *pHeight
= 1;
158 if((Caps
.TextureCaps
& D3DPTEXTURECAPS_POW2
) && !is_pow2(*pWidth
)) make_pow2(*pWidth
); /* !!! */
159 if(*pWidth
> Caps
.MaxTextureWidth
) *pWidth
= Caps
.MaxTextureWidth
;
162 if((Caps
.TextureCaps
& D3DPTEXTURECAPS_POW2
) && !is_pow2(*pHeight
)) make_pow2(*pHeight
);
163 if(*pHeight
> Caps
.MaxTextureHeight
) *pHeight
= Caps
.MaxTextureHeight
;
165 if(pWidth
&& pHeight
&& (Caps
.TextureCaps
& D3DPTEXTURECAPS_SQUAREONLY
)) {
166 if(*pWidth
> *pHeight
) *pHeight
= *pWidth
;
167 else *pWidth
= *pHeight
;
175 if( !pWidth
&& !pHeight
) MaxMipMaps
= 9;
177 UINT BufWidth
= (pWidth
) ? (*pWidth
) : 1;
178 UINT BufHeight
= (pHeight
) ? (*pHeight
) : 1;
180 while(BufWidth
> 1 || BufHeight
> 1) {
186 if(*pMipLevels
== 0 || *pMipLevels
> MaxMipMaps
) *pMipLevels
= MaxMipMaps
;
193 D3DDEVICE_CREATION_PARAMETERS CPars
;
197 IDirect3DDevice9_GetDirect3D(pDevice
, &pD3D
);
198 IDirect3DDevice9_GetCreationParameters(pDevice
, &CPars
);
199 IDirect3DDevice9_GetDisplayMode(pDevice
, 0, &Mode
);
201 if(*pFormat
== D3DFMT_UNKNOWN
|| *pFormat
== D3DX_DEFAULT
) *pFormat
= D3DFMT_A8R8G8B8
;
202 hr
= IDirect3D9_CheckDeviceFormat(pD3D
, CPars
.AdapterOrdinal
, CPars
.DeviceType
, Mode
.Format
, dwUsage
, D3DRTYPE_TEXTURE
, *pFormat
);
203 if(FAILED(hr
)) { /* Default to A8R8G8B8 */
204 *pFormat
= D3DFMT_A8R8G8B8
;
205 hr
= IDirect3D9_CheckDeviceFormat(pD3D
, CPars
.AdapterOrdinal
, CPars
.DeviceType
, Mode
.Format
, dwUsage
, D3DRTYPE_TEXTURE
, *pFormat
);
207 IDirect3D9_Release(pD3D
);
209 if(FAILED(hr
)) return D3DERR_INVALIDCALL
;
215 /************************************************************
218 * Changes the input parameters to make sure the texture creation is supported
219 * by the device and creates the texture upon these values
222 * pDevice [I] device which will create the texture
223 * Width [I] width of the texture
224 * Height [I] height of the texture
225 * MipLevels [I] number of miplevels to use
226 * dwUsage [I] usage of the texture
227 * Format [I] format of the texture
228 * Pool [I] pool of the texture
229 * pTexture [O] texture to be created
233 * Failure: D3DERR_INVALIDCALL, if there's no way to create a supported texture or
234 * if pDevice, dwUsage or Pool have invalid values
237 HRESULT WINAPI
D3DXCreateTexture(LPDIRECT3DDEVICE9 pDevice
,
244 LPDIRECT3DTEXTURE9
*pTexture
)
249 if( !pDevice
|| !pTexture
) return D3DERR_INVALIDCALL
;
251 hr
= D3DXCheckTextureRequirements(pDevice
, &Width
, &Height
, &MipLevels
, dwUsage
, &Format
, Pool
);
252 if(FAILED(hr
)) return hr
;
254 return IDirect3DDevice9_CreateTexture(pDevice
, Width
, Height
, MipLevels
, dwUsage
, Format
, Pool
, pTexture
, NULL
);
257 /************************************************************
258 * D3DXCreateTextureFromFileInMemoryEx
260 * Fills a D3DXIMAGE_INFO structure with info about an image
263 * pDevice [I] device used to create the texture
264 * pSrcData [I] pointer to the source data
265 * SrcDataSize [I] size of the source data, in bytes
266 * Width [I] width of the texture
267 * Height [I] height of the texture
268 * MipLevels [I] number of miplevels to use
269 * dwUsage [I] usage of the texture
270 * Format [I] format of the texture
271 * Pool [I] pool of the texture
272 * dwFilter [I] filter to apply when stretching
273 * dwMipFilter [I] filter to apply when generating mipmaps
274 * ColorKey [I] color key to apply
275 * pSrcInfo [O] pointer to a D3DXIMAGE_INFO structure
276 * pPalette [O] pointer to a 256-color palette to fill in
277 * ppTexture [O] pointer to the texture
281 * Failure: D3DXERR_INVALIDDATA
283 * D3DERR_NOTAVAILABLE, if a requested attribute is not available
284 * D3DERR_OUTOFVIDEOMEMORY
287 * Width, Height, MipLevels and Format can be set to D3DX_DEFAULT.
288 * We'll read them from the file then.
290 * dwFilter and dwMipFilter can be set to D3DX_DEFAULT, too. dwFilter equals
291 * to D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER and dwMipFilter equals to
292 * D3DX_FILTER_BOX then.
294 * dwUsage may only be 0, D3DUSAGE_DYNAMIC and/or D3DUSAGE_RENDERTARGET
296 * if Format is D3DFMT_UNKNOWN we'll use a format which matches the
297 * file's one best. If Format is D3DFMT_FROM_FILE, we'll only use
298 * the file's format and fail if it's not supported.
300 * ColorKey is always a 32-bit ARGB color. If it's 0, color-keying is disabled.
302 * pSrcInfo and pPalette can be NULL.
305 HRESULT WINAPI
D3DXCreateTextureFromFileInMemoryEx(LPDIRECT3DDEVICE9 pDevice
,
317 D3DXIMAGE_INFO
*pSrcInfo
,
318 PALETTEENTRY
*pPalette
,
319 LPDIRECT3DTEXTURE9
*ppTexture
)
321 IDirect3DTexture9
**ppTexptr
;
322 IDirect3DTexture9
*pBuftex
;
323 IDirect3DSurface9
*pSurface
;
324 BOOL WidthFromFile
= FALSE
, HeightFromFile
= FALSE
;
325 BOOL FormatFromFile
= FALSE
, MipLevelsFromFile
= FALSE
;
326 D3DXIMAGE_INFO ImgInfo
;
330 /* check for invalid parameters */
331 if( !pDevice
|| !ppTexture
|| !pSrcData
|| !SrcDataSize
) return D3DERR_INVALIDCALL
;
332 if((dwFilter
& 0xFFFF) > D3DX_FILTER_BOX
&& dwFilter
!= D3DX_DEFAULT
) return D3DERR_INVALIDCALL
;
333 if((dwMipFilter
& 0xFFFF) > D3DX_FILTER_BOX
&& dwMipFilter
!= D3DX_DEFAULT
) return D3DERR_INVALIDCALL
;
334 if( !dwFilter
|| !dwMipFilter
) return D3DERR_INVALIDCALL
;
336 hr
= D3DXGetImageInfoFromFileInMemory(pSrcData
, SrcDataSize
, &ImgInfo
);
342 /* handle default values */
343 if(Width
== 0 || Width
== D3DX_DEFAULT_NONPOW2
) Width
= ImgInfo
.Width
;
344 if(Height
== 0 || Height
== D3DX_DEFAULT_NONPOW2
) Height
= ImgInfo
.Height
;
345 if(Width
== D3DX_DEFAULT
) Width
= make_pow2(ImgInfo
.Width
);
346 if(Height
== D3DX_DEFAULT
) Height
= make_pow2(ImgInfo
.Height
);
347 if(Format
== D3DFMT_UNKNOWN
|| Format
== D3DX_DEFAULT
) Format
= ImgInfo
.Format
;
349 if(Width
== D3DX_FROM_FILE
) {
350 WidthFromFile
= TRUE
;
351 Width
= ImgInfo
.Width
;
353 if(Height
== D3DX_FROM_FILE
) {
354 HeightFromFile
= TRUE
;
355 Height
= ImgInfo
.Height
;
357 if(Format
== D3DFMT_FROM_FILE
) {
358 FormatFromFile
= TRUE
;
359 Format
= ImgInfo
.Format
;
361 if(MipLevels
== D3DX_FROM_FILE
) {
362 MipLevelsFromFile
= TRUE
;
363 MipLevels
= ImgInfo
.MipLevels
;
365 if(dwFilter
== D3DX_DEFAULT
) dwFilter
= D3DX_FILTER_TRIANGLE
| D3DX_FILTER_DITHER
;
366 if(dwMipFilter
== D3DX_DEFAULT
) dwMipFilter
= D3DX_FILTER_BOX
;
368 /* fix texture creation parameters */
369 hr
= D3DXCheckTextureRequirements(pDevice
, &Width
, &Height
, &MipLevels
, dwUsage
, &Format
, Pool
);
375 if(WidthFromFile
&& Width
!= ImgInfo
.Width
) return D3DERR_NOTAVAILABLE
;
376 if(HeightFromFile
&& Height
!= ImgInfo
.Height
) return D3DERR_NOTAVAILABLE
;
377 if(FormatFromFile
&& Format
!= ImgInfo
.Format
) return D3DERR_NOTAVAILABLE
;
378 if(MipLevelsFromFile
&& MipLevels
!= ImgInfo
.MipLevels
) return D3DERR_NOTAVAILABLE
;
380 /* Create the to-be-filled texture */
381 if(Pool
!= D3DPOOL_DEFAULT
&& dwUsage
!= D3DUSAGE_DYNAMIC
) {
382 hr
= D3DXCreateTexture(pDevice
, Width
, Height
, MipLevels
, dwUsage
, Format
, Pool
, ppTexture
);
383 ppTexptr
= ppTexture
;
385 hr
= D3DXCreateTexture(pDevice
, Width
, Height
, MipLevels
, dwUsage
, Format
, D3DPOOL_SYSTEMMEM
, &pBuftex
);
394 IDirect3DTexture9_GetSurfaceLevel(*ppTexptr
, 0, &pSurface
);
395 hr
= D3DXLoadSurfaceFromFileInMemory(pSurface
, pPalette
, NULL
, pSrcData
, SrcDataSize
, NULL
, dwFilter
, ColorKey
, NULL
);
396 IDirect3DSurface9_Release(pSurface
);
398 IDirect3DTexture9_Release(*ppTexptr
);
403 D3DXFilterTexture((IDirect3DBaseTexture9
*)*ppTexptr
, pPalette
, 0, dwMipFilter
);
405 /* Move the data to the actual texture if necessary */
406 if(ppTexptr
== &pBuftex
) {
407 hr
= D3DXCreateTexture(pDevice
, Width
, Height
, MipLevels
, dwUsage
, Format
, Pool
, ppTexture
);
409 IDirect3DTexture9_Release(pBuftex
);
413 IDirect3DDevice9_UpdateTexture(pDevice
, (IDirect3DBaseTexture9
*)pBuftex
, (IDirect3DBaseTexture9
*)(*ppTexture
));
414 IDirect3DTexture9_Release(pBuftex
);
416 if(pSrcInfo
) *pSrcInfo
= ImgInfo
;
421 HRESULT WINAPI
D3DXCreateTextureFromFileInMemory(LPDIRECT3DDEVICE9 pDevice
,
424 LPDIRECT3DTEXTURE9
*ppTexture
)
426 TRACE("(void): relay\n");
427 return D3DXCreateTextureFromFileInMemoryEx(pDevice
, pSrcData
, SrcDataSize
, D3DX_DEFAULT
, D3DX_DEFAULT
, D3DX_DEFAULT
, 0, D3DFMT_UNKNOWN
,
428 D3DPOOL_MANAGED
, D3DX_DEFAULT
, D3DX_DEFAULT
, 0, NULL
, NULL
, ppTexture
);
431 HRESULT WINAPI
D3DXCreateTextureFromFileA(LPDIRECT3DDEVICE9 pDevice
,
433 LPDIRECT3DTEXTURE9
*ppTexture
)
435 TRACE("(void): relay\n");
436 return D3DXCreateTextureFromFileExA(pDevice
, pSrcFile
, D3DX_DEFAULT
, D3DX_DEFAULT
, D3DX_DEFAULT
, 0, D3DFMT_UNKNOWN
,
437 D3DPOOL_MANAGED
, D3DX_DEFAULT
, D3DX_DEFAULT
, 0, NULL
, NULL
, ppTexture
);
440 HRESULT WINAPI
D3DXCreateTextureFromFileW(LPDIRECT3DDEVICE9 pDevice
,
442 LPDIRECT3DTEXTURE9
*ppTexture
)
444 TRACE("(void): relay\n");
445 return D3DXCreateTextureFromFileExW(pDevice
, pSrcFile
, D3DX_DEFAULT
, D3DX_DEFAULT
, D3DX_DEFAULT
, 0, D3DFMT_UNKNOWN
,
446 D3DPOOL_MANAGED
, D3DX_DEFAULT
, D3DX_DEFAULT
, 0, NULL
, NULL
, ppTexture
);
449 HRESULT WINAPI
D3DXCreateTextureFromFileExA(LPDIRECT3DDEVICE9 pDevice
,
460 D3DXIMAGE_INFO
*pSrcInfo
,
461 PALETTEENTRY
*pPalette
,
462 LPDIRECT3DTEXTURE9
*ppTexture
)
467 TRACE("(void): relay\n");
469 if( !pDevice
|| !pSrcFile
|| !ppTexture
) return D3DERR_INVALIDCALL
;
471 dwStrLength
= MultiByteToWideChar(CP_ACP
, 0, pSrcFile
, -1, NULL
, 0);
472 pWideName
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, dwStrLength
* sizeof(WCHAR
));
473 MultiByteToWideChar(CP_ACP
, 0, pSrcFile
, -1, pWideName
, dwStrLength
);
475 hr
= D3DXCreateTextureFromFileExW(pDevice
, pWideName
, Width
, Height
, MipLevels
,
476 dwUsage
, Format
, Pool
, dwFilter
, dwMipFilter
,
477 ColorKey
, pSrcInfo
, pPalette
, ppTexture
);
478 HeapFree(GetProcessHeap(), 0, pWideName
);
483 HRESULT WINAPI
D3DXCreateTextureFromFileExW(LPDIRECT3DDEVICE9 pDevice
,
494 D3DXIMAGE_INFO
*pSrcInfo
,
495 PALETTEENTRY
*pPalette
,
496 LPDIRECT3DTEXTURE9
*ppTexture
)
501 TRACE("(void): relay\n");
503 if( !pDevice
|| !pSrcFile
|| !ppTexture
) return D3DERR_INVALIDCALL
;
505 hr
= map_view_of_file(pSrcFile
, &pBuffer
, &dwSize
);
506 if(FAILED(hr
)) return D3DXERR_INVALIDDATA
;
508 hr
= D3DXCreateTextureFromFileInMemoryEx(pDevice
, pBuffer
, dwSize
, Width
, Height
, MipLevels
, dwUsage
, Format
,
509 Pool
, dwFilter
, dwMipFilter
, ColorKey
, pSrcInfo
, pPalette
, ppTexture
);
510 UnmapViewOfFile(pBuffer
);
515 HRESULT WINAPI
D3DXCreateTextureFromResourceA(LPDIRECT3DDEVICE9 pDevice
,
518 LPDIRECT3DTEXTURE9
*ppTexture
)
520 TRACE("(void): relay\n");
521 return D3DXCreateTextureFromResourceExA(pDevice
, hSrcModule
, pResource
, D3DX_DEFAULT
, D3DX_DEFAULT
, D3DX_DEFAULT
, 0, D3DFMT_UNKNOWN
,
522 D3DPOOL_MANAGED
, D3DX_DEFAULT
, D3DX_DEFAULT
, 0, NULL
, NULL
, ppTexture
);
525 HRESULT WINAPI
D3DXCreateTextureFromResourceW(LPDIRECT3DDEVICE9 pDevice
,
528 LPDIRECT3DTEXTURE9
*ppTexture
)
530 TRACE("(void): relay\n");
531 return D3DXCreateTextureFromResourceExW(pDevice
, hSrcModule
, pResource
, D3DX_DEFAULT
, D3DX_DEFAULT
, D3DX_DEFAULT
, 0, D3DFMT_UNKNOWN
,
532 D3DPOOL_MANAGED
, D3DX_DEFAULT
, D3DX_DEFAULT
, 0, NULL
, NULL
, ppTexture
);
535 HRESULT WINAPI
D3DXCreateTextureFromResourceExA(LPDIRECT3DDEVICE9 pDevice
,
547 D3DXIMAGE_INFO
*pSrcInfo
,
548 PALETTEENTRY
*pPalette
,
549 LPDIRECT3DTEXTURE9
*ppTexture
)
552 TRACE("(void): relay\n");
554 if( !pDevice
|| !ppTexture
) return D3DERR_INVALIDCALL
;
556 ResInfo
= FindResourceA(hSrcModule
, pResource
, (LPCSTR
)RT_RCDATA
);
562 hr
= load_resource_into_memory(hSrcModule
, ResInfo
, &pBuffer
, &dwSize
);
563 if(FAILED(hr
)) return D3DXERR_INVALIDDATA
;
564 return D3DXCreateTextureFromFileInMemoryEx(pDevice
, pBuffer
, dwSize
, Width
,
565 Height
, MipLevels
, dwUsage
, Format
,
566 Pool
, dwFilter
, dwMipFilter
, ColorKey
,
567 pSrcInfo
, pPalette
, ppTexture
);
570 ResInfo
= FindResourceA(hSrcModule
, pResource
, (LPCSTR
)RT_BITMAP
);
572 FIXME("Implement loading bitmaps from resource type RT_BITMAP\n");
575 return D3DXERR_INVALIDDATA
;
578 HRESULT WINAPI
D3DXCreateTextureFromResourceExW(LPDIRECT3DDEVICE9 pDevice
,
590 D3DXIMAGE_INFO
*pSrcInfo
,
591 PALETTEENTRY
*pPalette
,
592 LPDIRECT3DTEXTURE9
*ppTexture
)
595 TRACE("(void): relay\n");
597 if( !pDevice
|| !ppTexture
) return D3DERR_INVALIDCALL
;
599 ResInfo
= FindResourceW(hSrcModule
, pResource
, (LPCWSTR
)RT_RCDATA
);
605 hr
= load_resource_into_memory(hSrcModule
, ResInfo
, &pBuffer
, &dwSize
);
606 if(FAILED(hr
)) return D3DXERR_INVALIDDATA
;
607 return D3DXCreateTextureFromFileInMemoryEx(pDevice
, pBuffer
, dwSize
, Width
,
608 Height
, MipLevels
, dwUsage
, Format
,
609 Pool
, dwFilter
, dwMipFilter
, ColorKey
,
610 pSrcInfo
, pPalette
, ppTexture
);
613 ResInfo
= FindResourceW(hSrcModule
, pResource
, (LPCWSTR
)RT_BITMAP
);
615 FIXME("Implement loading bitmaps from resource type RT_BITMAP\n");
618 return D3DXERR_INVALIDDATA
;