LockBuffer

Locks a buffer for direct memory access

Declaration

N_uint32 GA_bufferFuncs::LockBuffer(
    GA_buf *buf)

Prototype In

snap/graphics.h

Parameters

buf

Buffer to lock

 

Return Value

Physical address of locked buffer in memory, 0 if a system memory buffer.

Description

This function locks a buffer so that an application can begin drawing directly on the surface memory. You must call this function before you draw directly on the bitmap surface! After this function is called, the GA_buf Surface member will be set to the virtual address of the buffer. Prior to calling this function and after calling UnlockBuffer, the Surface member will be set to NULL (indicating you should not access the memory!).

The return value from this function is the physical start address of the buffer in memory, which can be used to program DMA operations from other hardware devices directly into the video memory for the buffer. This is useful for frame grabber devices so that the resulting frame from the frame grabber device can be blitted to the visual display as quickly as possible (much quicker than if it was DMA'ed into system memory).

If the buffer is a system memory buffer, the return value from this function will be 0, since we cannot obtain the physical starting address of a system memory buffer.

SEE ALSO UnlockBuffer

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com