Jump to content
  • Advertisement
Sign in to follow this  
unicorn11

OpenGL is there a directx equal for glTexSubImage2D

This topic is 4395 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

Hi, have a function that returns me a array of const unsigned char's which i need to use to convert into a texture. OpenGL has a function called as glTexSubImage2D that can use the char's. Is there a directx function that does something like this? and any example of such the directx function will also be realllly helpful. regards Abhishek

Share this post


Link to post
Share on other sites
Advertisement
D3DXLoadSurfaceFromMemory will do what you want. You'll have to create your texture first (Using IDirect3DDevice9::CreateTexture(), then get surface level 0 (With IDirect3DTexture9::GetSurfaceLevel()), then call D3DXLoadSurfaceFromMemory() to fill the surface, and finally release the surface.

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!