UNLOCKBUFFER

Top  Previous  Next

Syntax

INT = UNLOCKBUFFER(OPT buffer as POINTER)

Description

Unlocks a previously locked buffer.

Parameters

buffer - Optional. Can be either BACKBUFFER (default) or FRONTBUFFER

Return value

Returns the current lock count if the buffer could be locked or -1 on error.

Remarks

Locking a buffer makes the video card memory directly accessible by your program for direct buffer manipulation. All drawing operations lock the buffer before performing any tasks on the buffer. Every call to LOCKBUFFER must be matched with a call to UNLOCKBUFFER.

The buffer must be unlocked before it can be flipped, blitted to, or drawn on with the GDI.

See Also: LOCKBUFFER

Example usage

LOCKBUFFER
    FOR y=0 to 599
        FOR x=0 to 799
            WritePixelFast(x,y,c)
        NEXT x
    NEXT y
UNLOCKBUFFER