Microsoft Windows CE 3.0  

VIDMEM

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The VIDMEMstructure manages the display memory into heaps.

typedef struct _VIDMEM { DWORD
dwFlags
;
FLATPTR
fpStart
;
union
{
FLATPTR
fpEnd
;
DWORD
dwWidth
;
};
DDSCAPS
ddsCaps
;
DDSCAPS
ddsCapsAlt
;
union
{
LPVMEMHEAP
lpHeap
;
DWORD
dwHeight
;
};} 
VIDMEM; 
typedef VIDMEM FAR *LPVIDMEM;

Members

dwFlags
Indicates the type of display memory.
Flag Usage
VIDMEM_ISHEAP Reserved for future use.
VIDMEM_ISLINEAR Indicates linear memory.
VIDMEM_ISNONLOCAL The heap resides in nonlocal (AGP) memory.
VIDMEM_ISRECTANGULAR Indicates rectangular memory.
VIDMEM_ISWC The driver has enabled write combining on the display memory in this heap. Write combining is a special caching mode in Pentium Pro-class processors that batches writes to the same cache line so they can be transferred in a single bus clock. Write combining does not preserve ordering of the writes, a tradeoff that is usually acceptable for frame buffers. Refer to Intel documentation for more information on write combining.
fpStart
Indicates the starting address of the memory range in the heap.
fpEnd
Indicates the ending address of the memory range, if the heap is linear. This address is inclusive, i.e., it specifies the last valid address in the range. Thus, the number of bytes specified by fpStartand fpEndis (fpEnd-fpStart+1).
dwWidth
Indicates the width of a memory chunk in rectangular memory.
ddsCaps
DDSCAPSstructure that indicates what this memory cannot be used for.
ddsCapsAlt
Structure that indicates what this memory cannot be used for if no other memory is found on the first pass.
lpHeap
Indicates the heap pointer used by DirectDraw.
dwHeight
Indicates the height of a memory chunk in rectangular memory.

Remarks

DirectDraw scans through to allocate its surfaces in the order the display memory heaps are listed. Heaps are managed in an array of VIDMEMstructures. The memory allocated first is the memory that is accessed first. The VIDMEMstructure sets up certain starting points, and determines the amount of memory on the surface and what cannot be done with the surface. DirectDraw manages it by suballocating and deallocating memory, that is, creating and destroying surfaces under each heap's jurisdiction. Physical limits determine how to set up these attributes.

DirectDraw's heap manager makes two passes through the VIDMEMstructures. The ddsCaps member indicates to DirectDraw what the memory in the heap cannot be used for on the first pass. For example, if the heap were just big enough for a back buffer, sprites could be excluded from being allocated on the first pass by setting the DSCAPS_OFFSCREENPLAINflag in the DDSCAPSstructure. That way, other surfaces would fill up with sprites, while preserving the back buffer for page flipping. The ddsCapsAlt member could be set to allow sprites on the second pass (by removing the DSCAPS_OFFSCREENPLAINflag). This allows heaps to be used preferentially for their highest and best use, without ruling out alternative uses. By choosing the order of allocation carefully (for example, by listing the back buffer last), the need to sort by ddsCapsand ddsCapsAltcan sometimes be eliminated.



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.