Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

The C modest god

Creating texture in D3D

This topic is 5462 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 have created a texture using IDirect3DDevice9 CreateTexture method. Now I need to fill it with the image data. There is a lock rectangle method but it locks only a single level of the texture. Do I need to create and copy the image data to all the texture levels? or is there a way to copy only the topmost level and generate all the rest of the levels?

Share this post

Link to post
Share on other sites
You can fill the first level with your image data and then call IDirect3dTexture9::GenerateMipSubLevels. That should do the trick.

Just in case you''re not aware of it, if your image data is coming from a file, in-memory file, or a resource, you can use D3DXCreateTextureFromFile, D3DXCreateTextureFromFileInMemory, or D3DXCreateTextureFromResource, respectively instead of loading it manually.


Share this post

Link to post
Share on other sites

  • 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!