Using D3DXCreateTextureFromResource for non bmp images

RandomTiger

New member
Joined
Jun 22, 2003
Messages
2
Hi there, Im having real trouble finding example code / tutorials using this function (D3DXCreateTextureFromResource).

So far I have managed to get it working with a bmp from the resources. However I want to be able to load a jpg (which it says it supports) because I need to keep file sizes down, it says that the image must be registered as a custom resource but I dont know how to do that.
 
Can you post the sample project youre using that loads a bmp from a resource? Ill see if I cant get the JPG to load.

-Nerseus
 
hr = D3DXCreateTextureFromResource(m_pd3dDevice,
GetModuleHandle(NULL),
MAKEINTRESOURCE(
IDB_BITMAP),
&m_texture);

Heres the code, I would prefer not to post the whole code at this point. I think its something to do with how I include a resource in the project. Its more of a win32 problem.

Even if I could just read it from the registry into memory and then pass it to D3DXCreateTextureFromMemory but I just cant work out how to load a custom resource.
 
Back
Top