Jump to content
  • Advertisement
Sign in to follow this  
DarkZoulz

Wierd problem!?

This topic is 4999 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

I'm attempting to create a mesh with D3DXCreateMeshFVF, but i'm recieving some really wierd debug errors. The actual call to D3DXCreateMeshFVF works fine and i've filled the vertex, index and attribute buffers of the mesh object. My device->Clear() call returns an OUT_OF_MEMORY error and D3D debug starts spitting out:
First-chance exception at 0x77f8c446 in win32Build.exe: 0xC0000005: Access violation writing location 0x3ef5918e.
Direct3D8: (WARN) :Alloc of size 76 FAILED!
First-chance exception at 0x77f8c446 in win32Build.exe: 0xC0000005: Access violation writing location 0x3ef5918e.
Direct3D8: (WARN) :Alloc of size 44 FAILED!
Direct3D8: (ERROR) :failed to allocate space for rects

First-chance exception at 0x7c59bbf3 in win32Build.exe: Microsoft C++ exception: long @ 0x0012fa10.
Direct3D8: (ERROR) :Clear failed.
I'm not even attempting to draw the mesh or anything. I'm just running clear, beginscene, endscene and present... Any clues?

Share this post


Link to post
Share on other sites
Advertisement
You got to be kidding me... it was the FVF I was setting for the mesh. I used D3DFVF_TEX0 instead of TEX1...why wouldn't that work anyway?

Share this post


Link to post
Share on other sites
By using D3DFVF_TEX0, you were telling DirectX that you had no texture coordinates. Therefore, DirectX didn't allocate any memory for the texture coordinates and expected your vertex structure to be of a certain size. Then, you presumably stuffed vertices with texture coordinates into the mesh. Since the actual data didn't match the FVF you specified, the whole process went a bit pair-shaped.

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!