当前位置: 首页>>代码示例>>C++>>正文


C++ TexturePtr::c_ptr方法代码示例

本文整理汇总了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);
}
开发者ID:ak4hige,项目名称:myway3d,代码行数:29,代码来源:MWD3D9VideoBufferManager.cpp

示例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);
}
开发者ID:ak4hige,项目名称:myway3d,代码行数:32,代码来源:MWD3D9VideoBufferManager.cpp

示例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;
	}
开发者ID:MSoft1115,项目名称:Rad3D,代码行数:31,代码来源:NullHWBufferManager.cpp


注:本文中的TexturePtr::c_ptr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。