本文整理汇总了C++中LPDIRECT3DDEVICE::CreateTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECT3DDEVICE::CreateTexture方法的具体用法?C++ LPDIRECT3DDEVICE::CreateTexture怎么用?C++ LPDIRECT3DDEVICE::CreateTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECT3DDEVICE
的用法示例。
在下文中一共展示了LPDIRECT3DDEVICE::CreateTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
LPDIRECT3DTEXTURE d3d_texture_new(LPDIRECT3DDEVICE dev,
const char *path, unsigned width, unsigned height,
unsigned miplevels, unsigned usage, D3DFORMAT format,
D3DPOOL pool, unsigned filter, unsigned mipfilter,
D3DCOLOR color_key, void *src_info_data,
PALETTEENTRY *palette)
{
HRESULT hr;
LPDIRECT3DTEXTURE buf;
D3DXIMAGE_INFO *src_info = (D3DXIMAGE_INFO*)src_info_data;
if (path)
hr = D3DXCreateTextureFromFileExA(dev,
path, width, height, miplevels, usage, format,
pool, filter, mipfilter, color_key, src_info,
palette, &buf);
else
{
hr = dev->CreateTexture(width, height, miplevels, usage,
format, pool, &buf
#ifndef _XBOX1
, NULL
#endif
);
}
if (FAILED(hr))
return NULL;
return buf;
}