游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1523|回复: 1

求助:CreatVertexBuffer发生内存访问异常

[复制链接]

14

主题

345

帖子

376

积分

中级会员

Rank: 3Rank: 3

积分
376
QQ
发表于 2007-5-19 17:21:00 | 显示全部楼层 |阅读模式
程序编译通过,执行到这里时发生异常:
        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)
==================================================================================
哪位大侠解救小弟一下????感激不尽

1

主题

51

帖子

51

积分

注册会员

Rank: 2

积分
51
发表于 2007-5-20 00:15:00 | 显示全部楼层

Re:求助:CreatVertexBuffer发生内存访问异常

589824换小点试试
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-26 10:41

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表