作者waquey ()
站内GameDesign
标题[程式] 关於D3DTexture Release
时间Mon Aug 27 19:43:19 2012
想问一下
有没有人有碰过D3D9 Texture Release时
有Access violation的问题
以下是大致code
IDirect3DTexture9 * pD3DTexture = NULL;
hr = m_pD3DDevice->CreateTexture(
width,height,0,0,D3DFMT_A8R8G8B8,D3DPOOL_DEFAULT,&pD3DTexture,NULL);
中间就作些Lock Rect将system buffer copy进去texture
或用UpdateTexture来更新
最後再作pD3DTexture->Release();
就会在这里显示Access violation reading(pointer非0)
请问有可能是什麽原因呢?
因为若texture没create成功 pointer应该也会是空的才对吧?
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.163.84.235
1F:→ azureblaze:文件好像没说失败pointer会怎样,检查一下return ? 08/27 21:09
2F:→ azureblaze:失败也可能选择不写入之类的 08/27 21:10
3F:→ waquey:谢谢! return值是invalid call 08/28 09:32
4F:→ funbook:你的"D3DTexture Release"是不是只能用C++写,不能用C写啊? 08/28 13:24
5F:→ waquey:用C++写的没错 08/30 19:04
6F:→ kakue:DEFAULT_POOL 不能直接Lock哦!! 09/03 17:01