Drawing To TextureBuffer fails

Archives Forums/Blitz3D Bug Reports/Drawing To TextureBuffer fails

_PJ_(Posted 2015) [#1]
Function CreateHalo()
	Local Size=128
	Local Flags=1+2+4+8+256
	
	Local Halo=CreateTexture(Size,Size,Flags)
	
	SetBuffer TextureBuffer(Halo)
	LockBuffer TextureBuffer(Halo)
	
	Local r#
	Local Theta#
	
	Local O=Size*0.5
	Local Grade=255/O
	
	For Theta=0 To 360
		For r=0.01 To O Step 0.4
			Color 255-(r*Grade),255-(r*Grade),255-(r*Grade)
			Plot O+r*Sin(Theta),O+r*Cos(Theta)
		Next
	Next
	
	UnlockBuffer TextureBuffer(Halo)
	SetBuffer BackBuffer()

;Added for verification
	SaveBuffer(TextureBuffer(Halo),"texture.bmp")
	Return Halo
End Function


Windows 10 64-Bit
nVidia GeForce GTX750 Ti

Resulting texture is always blank.


Floyd(Posted 2015) [#2]
			Plot O+r*Sin(Theta),O+r*Cos(Theta)


Read the documentation for LockBuffer!


_PJ_(Posted 2015) [#3]
Doh!

Thanks, Floyd, removed the lock/unlock and it works!