Wierd problem!?

Started by
1 comment, last by Dave Hunt 19 years, 5 months ago
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?
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?
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.

This topic is closed to new replies.

Advertisement