Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • *Experts*
Posted

Can you post the sample project you're using that loads a bmp from a resource? I'll see if I can't get the JPG to load.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...