| Home
| Previous
| Next
| Up

MGLBUF

Declaration

typedef struct {
M_uint32 dwSize;
M_int32 width;
M_int32 height;
M_int32 bytesPerLine;
M_int32 cacheBytesPerLine;
M_int32 startX;
M_int32 startY;
M_int32 offset;
M_int32 flags;
M_int32 format;
M_int32 useageCount;
void *surface;
void *surfaceCache;
MGLDC *dc;
} MGLBUF

Prototype In

mgraph.h

Description

Structure representing a lightweight bitmap buffer in offscreen display memory. Offscreen buffers are used to store bitmap and sprite information in the offscreen memory in the hardware, but are not full offscreen DC's and hence have much less memory overhead than a full offscreen DC. Buffers can only be used for storing bitmaps and blitting the around on the screen. You can copy the contents to a MGL device context using the MGL_putBuffer, MGL_stretchBuffer and MGL_putBufferTransparent functions. You can also copy the contents of an MGL device context to a buffer using the MGL_copyToBuffer function.

If you need to draw on a buffer in offscreen memory, create a full offscreen device context instead, and then you can call any of the standard MGL drawing functions and BitBlt operations for the offscreen memory buffer. The primary disadvantage of doing this is that a full offscreen device context has a lot more memory overhead involved in maintaining the device context state information than a simple offscreen buffer.

Note: The MGL automatically manages offscreen display memory, and if you run out of offscreen display memory it will place the buffer surfaces in system memory. Hence you should allocate your important buffers first, to ensure they end up in offscreen memory.

Note: The MGL also manages the surface memory for the buffers, so that if your offscreen surfaces get lost (ie: on a fullscreen mode switch), they will automatically be restored when the application regains the active focus. This also allows the MGL to do automatic offscreen heap compaction when necessary to free up empty space on the heap.

Note: The dwSize member is intended for future compatibility, and should be set to the size of the structure as defined in this header file. Future drivers will be compatible with older software by examiming this value.

Members

dwSize | Size of the structure in bytes
width | Width of the offscreen buffer in pixels
height | Height of the offscreen buffer in pixels
bytesPerLine | Scanline width for the buffer in bytes
cacheBytesPerLine | Scanline width for the system memory buffer cache
startX | Internal value; do not use
startY | Internal value; do not use
offset | Internal value; do not use
flags | Flags for the buffer (MGL_bufferFlagsType)
format | Internal value; do not use
useageCount | Useage count for tracking pageable buffers
surface | Pointer to start of the buffer surface
surfaceCache | Pointer to surface cache in system memory (NULL if uncached)
dc | Display device context buffer is associated with

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