Load mesh from resource

Started by
0 comments, last by GameDev.net 24 years, 7 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