I can't modify my texture

Started by
2 comments, last by juhaszt 20 years, 6 months ago
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!!
programmer
Advertisement
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
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.
That was the only mistake I could do, and I have done it!!!!
Thank you for the solution, Anonymous Poster!!!!!
programmer

This topic is closed to new replies.

Advertisement