Jump to content
  • Advertisement
Sign in to follow this  
niblick

D3DXCreateTextureFromMemoryEx

This topic is 4554 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i've been having some trouble coming up with any documentation for "D3DXCreateTextureFromMemoryEx". i need to generate a texture and can't find out how to make my 'texture data' into an actual d3d 'texture'. thanks

Share this post


Link to post
Share on other sites
Advertisement
Does that function exist?

Try doing this: Create a texture using IDirect3DDevice9::CreateTexture or D3DXCreateTexture, then use IDirect3DTexture9::GetSurfaceLevel to access the texture's image data (as a surface). There is lots more involved, but that should get you going.

Share this post


Link to post
Share on other sites
Indeed it does exist, I don't remember the spefics but look it up in the DX-SDK. It may have been removed in DX-9. I'd have to see but I am at school atm.

Share this post


Link to post
Share on other sites

the only reference to it i could find was at this site. i have been looking about for alternatives and saw you can access the texture as a surface but i don't know how to directly copy memory over to it?

msdn doesn't seem to have 'D3DXCreateTextureFromMemory' which has been confusing me as it tends to retain legacy functions does it not?

Share this post


Link to post
Share on other sites
ok. i finally got on my computer and checked the sdk doc's.

it seems the function in question has been ommited from dx9 but has been replaced by 'D3DXCreateTextureFromFileInMemory'.

should be able to knock up a quick bmp header to attach to my data and load it in :)

would have been nice for the original to be on msn with a note redirecting you to the replacement.

Share this post


Link to post
Share on other sites
If you're thinking of the same thing I am, the actual function is D3DXLoadSurfaceFromMemory(). You have to already know the size/format of your image data, and create a texture. Then you grab the primary (or only) surface from the texture and and use the above function to load the data into it from memory. (Of course, you don't have to create a texture; you could create a surface another way, for example an off screen plain surface.)

Share this post


Link to post
Share on other sites
for completeness.
if anyone else finds themselves looking ot use this function a way round can be carried out using the 'D3DXLoadSurfaceFromMemory' function alongside the 'D3DXCreateTexture' and 'GetSurfaceLevel' functions.

isn't this just manually doing what 'D3DXCreateTextureFromMemory' would have performed?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!