is there a directx equal for glTexSubImage2D

Started by
1 comment, last by unicorn11 17 years, 7 months ago
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
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.
Thanks that worked.

This topic is closed to new replies.

Advertisement