| Home
| Previous
| Next
| Up

GA_BufferFlagsType

Declaration

typedef enum {
gaBufferSysMem = 0x00000001,
gaBufferCached = 0x00000002,
gaBufferMoveable = 0x00000004,
gaBufferPageable = 0x00000008,
gaBufferPriority = 0x00000010,
gaBufferNoSysMem = 0x00000020,
gaBuffer3D = 0x00000040,
gaBufferFlippable = 0x00010000,
gaBufferVideo = 0x00020000,
gaBufferDepth = 0x00040000,
gaBufferTexture = 0x00080000,
gaBufferStencil = 0x00100000,
gaBufferSpecial = 0x7FFF0000
} GA_BufferFlagsType

Prototype In

snap/graphics.h

Description

Flags for buffer flags passed to the AllocBuffer function. The flags define how the buffer is allocated, and the type of buffer.

The gaBufferSysMem flag indicates that the buffer is currently located in system memory only. It is possible for a buffer that was allocated with the gaBufferPageable and gaBufferCached flags to initially be in video memory but then get paged out to system memory to make space for higher priority buffers. You can also set this flag when you allocate a buffer to cause the buffer to be allocated in system memory instead of video memory.

The gaBufferCached flag indicates that the buffer should have a system memory cache allocated for it, so that it can be swapped in and out of video memory as necessary. Sometimes it may be useful to have buffers cached in system memory, but not have them pageable. Thus the system memory cache can be used to refresh the video memory as necessary if the video memory contents were lost (ie: on a focus switch etc). Note that the system memory cache is not maintained automaticaly by SNAP Graphics, but rather it is up to the application code to maintain the contents of the system memory cache if they need to be kept in sync. You can use the UpdateCache and UpdateFromCache functions to keep the system memory cache in sync as necessary.

The gaBufferMoveable flag indicates that the buffer should be allocated on the moveable buffer heap, so that the buffer can be moved around as necessary to compact the heap if it becomes fragmented. For buffers that should never move in video memory, this flag should not be set and the buffers will be allocated in the non-moveable or fixed heap.

The gaBufferPageable flag indicates that the buffer is a low priority buffer and can be paged to system memory in order to make room for higher priority buffers. Setting gaBufferPageable flag will automatically set the gaBufferCached flag so that there is a system memory cache for the buffer. Pageable buffers will be paged back into video memory when the heap becomes free of all non-pageable buffers. Hence shell drivers using the buffer manager to cache bitmaps etc should make those bitmaps all pageable, so that they will get pages to system memory if applications need more offscreen memory (ie: 2D or 3D graphics intensive apps). When the graphics intensive app exits, the pageable buffers will get pages back into video memory as all non-pageable buffers will have been free.

The gaBufferPriority flag indicates that the buffer is a high priority buffer. As long as there are any high priority buffers still allocated, the buffer manager will not attempt to page back in pageable buffers from system memory. Hence DirectDraw application buffers etc should be marked as priority buffers, so that pageable buffers will not be brought back into video memory until the DirectDraw app exits.

The gaBufferNoSysMem flag is used to indicate that the surface being created should only ever be allocated in video memory. If there is no video memory available, the buffer allocation function will fail (normally it will attempt to allocate the buffer in system memory if the gaBufferCached or gaBufferPageable flags are set).

The gaBuffer3D flag is used to indicate that the surface being created should be capable for being the destination for 3D hardware rendering. If you need hardware 3D capabilities for the primary and flippable buffers, you should pass this flag to the InitBuffers function when you initialise the buffer manager.

The gaBufferFlippable flag is used to indicate whether the buffer is a flippable buffer that can be viewed and made visible via the MakeVisibleBuffer function. All flippable buffers must be the same dimensions as the primary display mode, and are allocated when you first call the InitBuffers function to initialise the buffer manager.

The gaBufferVideo flag is an internal flag used to indicate that the buffer is a video overlay window buffer.

The gaBufferDepth flag is an internal flag used to indicate that the buffer is a hardware depth buffer.

The gaBufferTexture flag is an internal flag used to indicate that the buffer is a hardware texture map.

The gaBufferStencil flag is an internal flag used to indicate that the buffer is a hardware stencil bufer.

Note: These flags are also passed to the AllocBuffer function to determine how the buffer should be allocated. Some of the flags are internal and should never be passed to AllocBuffer as they are used internally. Flags above or equal to gaVideo are used internally to indicate what type of buffer is in use (since all buffers are internally allocated from the same heap).

Members

gaBufferSysMem | Buffer is currently located in system memory
gaBufferCached | Buffer is cached in system memory
gaBufferMoveable | Buffer can be moved around to compact buffer heap
gaBufferPageable | Buffer can be paged to system memory
gaBufferPriority | Buffer is a high priority bitmap
gaBufferNoSysMem | Buffer should never be in system memory
gaBufferFlippable | Buffer is a viewable, flippable surface
gaBuffer3D | Buffer is a hardware 3D capable surface
gaBufferVideo | Buffer is a video overlay window surface
gaBufferDepth | Buffer is a hardware depth buffer
gaBufferTexture | Buffer is a hardware texture map
gaBufferStencil | Buffer is a hardware stencil buffer
gaBufferSpecial | Mask to determine if buffer is special buffer

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