|
|
程序编译通过,执行到这里时发生异常:
V_RETURN( this->pd3dDevice->CreateVertexBuffer( this->GetVertexNum() * sizeof(CustomVertex),
0, D3DFVF_CustomVertex, D3DPOOL_DEFAULT, &(this->pVertexBuffer), NULL));
Terrain.exe 中的 0x004b9f07 处未处理的异常: 0xC0000005: 读取位置 0x00000000 时发生访问冲突
我跟踪到这儿,
this->GetVertexNum() * sizeof(CustomVertex)的值为589824
&(this->pVertexBuffer) 0x00655d60 IDirect3DVertexBuffer9 * *
this->pVertexBuffer 0x00000000 {Name=??? Length=??? Usage=??? ...} IDirect3DVertexBuffer9 *
其中我的FVF定义为:
//定义用户顶点结构体
struct CustomVertex
{
D3DXVECTOR4 position; //坐标
D3DXVECTOR3 normal; //法向量
D3DXVECTOR2 textureUV; //纹理坐标
};
//表现用户结构体相关信息的FVF值
#define D3DFVF_CustomVertex (D3DFVF_XYZW|D3DFVF_NORMAL|D3DFVF_TEX1)
==================================================================================
哪位大侠解救小弟一下????感激不尽 |
|