🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Load mesh from resource

Started by
0 comments, last by GameDev.net 24 years, 9 months ago
I need help loading a mesh from a resource using meshbuilder.

I added a custom resource to my applications resources called "MESH" and inserted a directx file IDR_MYMESH (mymesh.x).

Then I created a D3DRMLOADRESOURCE:
myResource.hModule = NULL;
myResource.lpName = MAKEINTRESOURCE(IDR_MYMESH);
myResource.lpType = "MESH"

then I called the meshbuilder load method:
myBuilder->Load( &myResource, NULL, D3DRMLOAD_FROMRESOURCE, NULL, NULL);

The problem seems to be that lpName isn't receiving the IDR_MYMESH resource name. It contains "".

Thanks...

Advertisement
IDR_MYMESH is the mesh resource
"MESH" is the section its located under
the quotes are part of the name.

This code SHOULD work.

D3DRMLOADRESOURCE resinfo;
resinfo.hModule = 0;
resinfo.lpName=MAKEINTRESOURCE(IDR_MYMESH);
resinfo.lpType="MESH";

d3drm->CreateMeshBuilder( &mesh );

mesh->Load(&resinfo, 0, D3DRMLOAD_FROMRESOURCE, 0, 0);

This topic is closed to new replies.

Advertisement