Game Development Community

Locking texture fails

by ArchieMD User · in Torque 3D Professional · 01/26/2010 (2:12 pm) · 2 replies

I have a texture which I am periodically writing to, in order to display webcam video. After a few frames worth of lock-->write-->unlock, I get this gem of an error in locking:

"GFXD3D9TextureObject::lock - could not lock non-RT texture!"

First off, way ambiguous as whether it's having a problem locking the texture (which happens to be non RT) or whether it's not allowed to lock an RT texture. Second, why would this error show up after a while instead of the first time?

#1
01/26/2010 (5:58 pm)
Update: can't lockRect a texture with a Dynamic flag (not related to the Dynamic + KeepBitmap bug). Always hit this assert
"GFXD3D9TextureObject::lock - could not lock non-RT texture!"
Same crash happens intermittently with Static textures as well. I'm doing the locking --> writing --> unlocking in prepRenderImage. Is that a bad place to do it? Or is this a bug? Or is it a directx issue?
#2
06/13/2012 (1:03 am)
I'm doing the same and having a crash related to it. Did you find out what was causing it in the end?