max2d.UnlockImage is .. blank?
BlitzMax Forums/BlitzMax Programming/max2d.UnlockImage is .. blank?
| ||
Function LockImage:TPixmap( image:TImage,frame=0,read_lock=True,write_lock=True ) Return image.Lock( frame,read_lock,write_lock ) End Function Function UnlockImage( image:TImage,frame=0 ) End Function TImage.Lock doesn't make much sense either.. Method Lock:TPixmap( index,read,write ) If write seqs[index]=0 frames[index]=Null EndIf If Not pixmaps[index] pixmaps[index]=CreatePixmap( width,height,PF_RGBA8888 ) EndIf Return pixmaps[index] End Method So, do we lock to get the pixmap and then setpixmap on the image..? |
| ||
Apparently you don't need to do anything after getting (*locking*) the pixmap for an image. |
| ||
That's correct. |
| ||
Silly practice.. Hopefully it can be sorted in the next release. |
| ||
When you use lock to get a writable pixmap, the image.seq field will be cleared, then the image must reupload its pixmap as texture when it get drawed next time. So the unlocking is actually automated. It might be sometimes confusing that calling unlock() is said to be a must while it's not. |