Archived

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

juhaszt

I can't modify my texture

Recommended Posts

I read a texture from a file and try to modify it. I lock it, write some data in the pixels, and unlock it. Everythings looks fine, no error codes. But when I use the texture I can not see any modification on it. Yes, my code could be wrong (or must be...). But I have copied the code from an SDK sample programm, and it works there, and seems to work in my programm to... but the texture is unchanged in my programm. Do you have any idea what could I try now???????????????? Please!!

Share this post


Link to post
Share on other sites
I have to admit that I have never done this type of thing, but I have a suggestion. If a texture is created and loaded into video memory, locking that texture may not necessarily change the copy in video memory.

I think that I remember reading that if you lock a texture that is in video memory, a copy is sent to system memory that you can write to. Then I think that you need to call a function called UpdateTexture, or UpdateSurface.

Just trying to help!
/jk

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
are you modifying all mip levels of the texture or only the biggest one? if your object is small enough on the screen, it might not use the largest mip level, and if that''s all you have written to, you won''t see any changes.

Share this post


Link to post
Share on other sites