Managed Meshes. Damn Microsoft. Damn them.

Started by
5 comments, last by dbuzaleski 20 years, 5 months ago
Okay...I understand how to create a Mesh object from an xfile. I understand how to render it. What I NEED to do, is create a mesh object based on an existing vertex buffer. And the DXSDK docs are just about useless for this. Any help would be appreciated. I''m working in C#, managed DX9.0a. Although I''m fluent enough in c++ that code in that language should help, too. On a closely related note...IS there any good docs on what the Mesh object really is, and what it''s members do? I swear, the SDK docs drive me batty. If I see one more function that takes an object of type "object" as a parameter, with no explanation at all, I''m going to scream. When I call up the SDK help page, it REALLY ought to have more info than the popup function autohelp does. -Daniel StupidStupidStupid game companies.
StupidStupidStupid game companies.
Advertisement
There is a method to save data to .x files in the docs.
C:\DXSDK\Doc\DirectX9\DirectX9_c.chm::/directx/graphics/programmingguide/advancedtopics/xfiles/savingxfile.htm
I assume you''re suggesting, then, that I take the data in my vertex buffer, save it as an xfile, and create the mesh from the xfile? That seems a rather indirect way to accomplish my goal. There has to be a way to access the Mesh data more directly. Or, more importantly, there has to be some documentation on how to do it...I suspect between the "SetVertexBufferData" and "FromStream" methods, there has to be a more direct route, but I can''t get it to work.

StupidStupidStupid game companies.
StupidStupidStupid game companies.
i don''t know anything about C# or managed DX9, whatever that means, but the D3DXCreateMeshFVF utility function will create an ID3DXMesh for you. you could then unlock that mesh''s vb and ib and fill them with your other data. that''s what i do anyway. if all you have is a vb then you''ll have to convert it to a vb/ib pair as all of the mesh interfaces use indexed vbs. if you have the data in another mesh then you can use the CloneMeshFVF method to get a copy. or the Optimize method will create a copy as well.
Anyone knows how to solve this,
creating a new Mesh just throws an exception with "Error in the application".
use D3DX to create a new empty mesh, get its vertex buffer, lock it, and copy the data in
die or be died...i think
Managed DirectX my friend...

This topic is closed to new replies.

Advertisement