2014-12-08 12:43:20 +13:00
< html >
< head >
< title > Blitz3D Docs< / title >
< link rel = stylesheet href = ../css/commands.css type = text/css >
< / head >
< body >
< h1 > UnlockBuffer buffer< / h1 >
< h1 > Parameters< / h1 >
< table >
< tr >
< td >
buffer = any valid screen/image buffer (optional)
< / td >
< / tr >
< / table >
< h1 > Description< / h1 >
< table >
< tr >
< td >
After you use LockBuffer on a buffer, the only graphics commands you can use are the read/write pixel commands ReadPixel, WritePixel, ReadPixelFast, and WritePixelFast. You must use this command before using other graphics commands.
< br / >
< br / >
The buffer parameter isn't required. If omitted, the default buffer set with SetBuffer will be used.
2014-02-26 16:08:39 +13:00
< br / >
2014-12-08 12:43:20 +13:00
< br / >
See the other commands for more information.
< br >
< br >
See also: < a class = small href = LockedPitch.htm > LockedPitch< / a > , < a class = small href = LockedFormat.htm > LockedFormat< / a > , < a class = small href = LockedPixels.htm > LockedPixels< / a > , < a class = small href = ReadPixelFast.htm > ReadPixelFast< / a > , < a class = small href = WritePixelFast.htm > WritePixelFast< / a > , < a class = small href = LockBuffer.htm > LockBuffer< / a > .
< / td >
< / tr >
< / table >
< h1 > < a href = ../2d_examples/UnlockBuffer.bb > Example< / a > < / h1 >
< table >
< tr >
< td >
; High Speed Graphics Commands
< br / >
< br / >
Graphics 640,480,16
< br / >
< br / >
; Draw a bunch of stuff on the screen
< br / >
For t= 1 To 1000
< br / >
Color Rnd(255),Rnd(255),Rnd(255)
< br / >
Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)
< br / >
Next
< br / >
< br / >
Delay 3000
< br / >
< br / >
; Copy the top half of the screen over the bottom half
< br / >
; using fast pixels and locked buffers
< br / >
For x = 1 To 640
< br / >
2014-02-26 16:08:39 +13:00
For y = 1 To 240
2014-12-08 12:43:20 +13:00
< br / >
2014-02-26 16:08:39 +13:00
LockBuffer FrontBuffer()
2014-12-08 12:43:20 +13:00
< br / >
2014-02-26 16:08:39 +13:00
WritePixelFast x,y+241,ReadPixelFast(x,y)