Jump to content
  • Advertisement
Sign in to follow this  
tariq9112003

Unhandled Exception when loading vertex buffer

This topic is 2875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey Guys..When i run my program..an unhandled exception message shows up

the details are

+ this 0x019f5ae0 {_device=0x02394320 _tex=0xcdcdcdcd _vb=0x0073e860 ...} Terrain * const
endX 315 int
hr S_OK HRESULT
startX -315 int
startZ 315 int
endZ -315 int
i -858993460 int
uCoordIncrementSize 0.015873017 float
vCoordIncrementSize 0.015873017 float
+ v 0x00000000 {_x=??? _y=??? _z=??? ...} Terrain::TerrainVertex *

the corresponding code is
[ source ]
TerrainVertex *v=0;
_vb->Lock(0, 0, (void**)v,0);
int i=0;
for(int z = startZ; z >= endZ; z -= _cellSpacing)
{
int j=0;
for(int x = startX; x <= endX; x += _cellSpacing)
{
int index= i*_numVertsPerRow +j;
v[index]= TerrainVertex((float)x, (float)_heightMap[index], (float)z, (float)i* uCoordIncrementSize, (float)j * vCoordIncrementSize);
j++;
}
i++;
}
_vb->Unlock();
[ /source ]

this is my entire program ,should the information not suffice
http://pastebin.com/TQdEpfVD

Share this post


Link to post
Share on other sites
Advertisement
What like does the exception occur on? What is the exact message? If it occurs on the v[index]= TerrainVertex(... line, then index probably refers to an invalid vertex (I.e. < 0 or >= _numVertices).

Share this post


Link to post
Share on other sites
Hey thanks..mhagain..no more exceptions :)..but still nothing shows up on my screen...its just blank...i am working on it now..and i have a hresult check on all the functions and i get no notice of any failure.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!