|
|
在DX8中
SetVertexShader(TERRAIN_D3DFVF_CUSTOMVERTEX)
这样就行了.
但在DX9中要求接受IDirect3DVertexShader9 *类型参数,我是这样用的
IDirect3DVertexShader9 * pShader;
...
DWORD CTerrain::Render()
{
m_pD3DDevice->SetStreamSource(0, m_pVertexBuffer,0, sizeof(TERRAIN_CUSTOMVERTEX));
m_pD3DDevice->SetVertexShader(pShader);
...
调试报错:
terrain2.exe 中的 0x00f3d52c 处未处理的异常: 0xC0000005: 读取位置 0xcdcdcded 时发生访问冲突 。
是否pShader没有初始化还是另有原因?
谢谢!
|
|