本文整理汇总了C++中TexturePtr::c_ptr方法的典型用法代码示例。如果您正苦于以下问题:C++ TexturePtr::c_ptr方法的具体用法?C++ TexturePtr::c_ptr怎么用?C++ TexturePtr::c_ptr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TexturePtr
的用法示例。
在下文中一共展示了TexturePtr::c_ptr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderTargetPtr
RenderTargetPtr D3D9VideoBufferManager::CreateRenderTarget(TexturePtr rtTex)
{
int rWidth = rtTex->GetWidth(), rHeight = rtTex->GetHeight();
if (rWidth == -1 || rHeight == -1)
{
rWidth = Engine::Instance()->GetDeviceProperty()->Width;
rHeight = Engine::Instance()->GetDeviceProperty()->Height;
}
IDirect3DSurface9 * pD3D9RenderTarget = NULL;
D3D9RenderTarget * pTexture = new D3D9RenderTarget(mD3D9Device);
pTexture->mName = rtTex->GetName();
pTexture->mWidth = rWidth;
pTexture->mHeight = rHeight;
pTexture->mFormat = rtTex->GetFormat();
pTexture->mMSAA = MSAA_NONE;
pTexture->mTexture = rtTex;
D3D9Texture * d3dTex = (D3D9Texture *)rtTex.c_ptr();
d3dTex->GetD3DTexture()->GetSurfaceLevel(0, &pTexture->mRenderTarget);
mRenderTargets.Insert(pTexture->GetName(), pTexture);
return RenderTargetPtr(pTexture);
}
示例2: assert
void D3D9VideoBufferManager::BitBlt(TexturePtr texDest, ImagePtr imageSrc, const Rect * pDest, const Rect * pSrc)
{
IDirect3DTexture9 * pD3DDestTexture = NULL;
IDirect3DTexture9 * pD3DSrcTexture = NULL;
if (texDest->GetTextureType() == TEXTYPE_2D)
{
pD3DDestTexture = static_cast<D3D9Texture*>(texDest.c_ptr())->mD3D9Texture;
}
D3D9Image * img = (D3D9Image*)imageSrc.c_ptr();
pD3DSrcTexture = img->_MyTexture();
assert(pD3DDestTexture && pD3DSrcTexture);
IDirect3DSurface9 * pDestSurface;
IDirect3DSurface9 * pSrcSurface;
const RECT * pDestRect = reinterpret_cast<const RECT *>(pDest);
const RECT * pSrcRect = reinterpret_cast<const RECT *>(pSrc);
pD3DDestTexture->GetSurfaceLevel(0, &pDestSurface);
pD3DSrcTexture->GetSurfaceLevel(0, &pSrcSurface);
D3DXLoadSurfaceFromSurface(pDestSurface,
NULL,
pDestRect,
pSrcSurface,
NULL,
pSrcRect,
D3DX_DEFAULT,
0);
}
示例3: LoadTexture
TexturePtr NullHWBufferManager::LoadTexture(const String & filename, float priority, int mipmaps, eUsage usage)
{
Hash2 hash(filename.c_str());
TexturePtr p = _find(hash, filename);
if (p == NULL)
{
NullTexture * pTexture = new NullTexture(filename, filename);
pTexture->mWidth = 0;
pTexture->mHeight = 0;
pTexture->mMipmaps = 1;
pTexture->mUsage = usage;
pTexture->mFormat = ePixelFormat::UNKNOWN;
pTexture->mPriority = priority;
p = pTexture;
mTextureMap.Insert(hash, p.c_ptr());
}
if (priority < 0)
{
p->EnsureLoad();
}
else
{
p->Load();
}
return p;
}