中级玩家
 
- 贡献度
- 34
- 金元
- 1703
- 积分
- 246
- 精华
- 0
- 注册时间
- 2008-6-22
|
找到了一篇文章好像是在解決這問題的,不過.........看不懂啊 [em07]
http://www.gamedev.net/community/forums/topic.asp?topic_id=508563
---------- 這段好像就是修証後的 , 但完全不知怎麼用 ------------ [em24]
I think I solved the issue:
Here is the updated code that did NOT CRASH!
HRESULT APIENTRY hkIDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9 *pTexture)
{
IDirect3DDevice9 *dev = NULL;
D3DLOCKED_RECT lockedRect;
D3DLOCKED_RECT* pLockedRect = &lockedRect;
if (pTexture != NULL && pTexture->GetType() == D3DRTYPE_TEXTURE)
{
((IDirect3DTexture*)pTexture)->LockRect(0, pLockedRect, NULL, D3DLOCK_NOOVERWRITE | D3DLOCK_READONLY);
}
if(dev == this)
return m_pD3Ddev->SetTexture(Stage, ((hkIDirect3DTexture9*)(pTexture))->m_D3Dtex);
}
Now, it seems I have access to the texture data!
高手出來吧 [em26] |
|