本文整理汇总了C++中CTexture::GetTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::GetTexture方法的具体用法?C++ CTexture::GetTexture怎么用?C++ CTexture::GetTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTexture
的用法示例。
在下文中一共展示了CTexture::GetTexture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTexture
CGLTexture* CTextureMap::GetTexture(int iPicture, int& iWidth, int& iHeight, SDL_Palette*& pPal, bool &linearTexture)
#endif
{
if (iPicture < 0 || iPicture >= (int)m_vecTexures.size()) return NULL;
CTexture* pTexture = m_vecTexures[iPicture];
return pTexture->GetTexture(iWidth, iHeight, pPal, linearTexture);
}
示例2: LoadTexture
void CGXRenderTexture::LoadTexture(TxtrCacheEntry* pEntry)
{
#if 0
//This function copies the current color buffer (m_pTexture for this RenderTexture) to pEntry->pTexture
bool IsBeingRendered = m_beingRendered;
if( IsBeingRendered )
{
TXTRBUF_DUMP(TRACE0("Warning, loading from render_texture while it is being rendered"));
SetAsRenderTarget(false);
//return;
}
CTexture *pSurf = pEntry->pTexture;
TxtrInfo &ti = pEntry->ti;
// Need to load texture from the saved back buffer
MYLPDIRECT3DTEXTURE pNewTexture = MYLPDIRECT3DTEXTURE(pSurf->GetTexture());
MYLPDIRECT3DSURFACE pNewSurface = NULL;
HRESULT res = pNewTexture->GetSurfaceLevel(0,&pNewSurface);
MYLPDIRECT3DSURFACE pSourceSurface = NULL;
(MYLPDIRECT3DTEXTURE(m_pTexture->GetTexture()))->GetSurfaceLevel(0,&pSourceSurface);
int left = (pEntry->ti.Address- m_pInfo->CI_Info.dwAddr )%m_pInfo->CI_Info.bpl + pEntry->ti.LeftToLoad;
int top = (pEntry->ti.Address- m_pInfo->CI_Info.dwAddr)/m_pInfo->CI_Info.bpl + pEntry->ti.TopToLoad;
RECT srcrect = {uint32(left*m_pInfo->scaleX) ,uint32(top*m_pInfo->scaleY),
uint32(min(m_width, left+(int)ti.WidthToLoad)*m_pInfo->scaleX),
uint32(min(m_height,top+(int)ti.HeightToLoad)*m_pInfo->scaleY) };
if( pNewSurface != NULL && pSourceSurface != NULL )
{
if( left < m_width && top<m_height )
{
RECT dstrect = {0,0,ti.WidthToLoad,ti.HeightToLoad};
HRESULT res = D3DXLoadSurfaceFromSurface(pNewSurface,NULL,&dstrect,pSourceSurface,NULL,&srcrect,D3DX_FILTER_POINT ,0xFF000000);
DEBUGGER_IF_DUMP(( res != S_OK), {DebuggerAppendMsg("Error to reload texture from render_texture, res=%x", res);} );