Compartir a través de


VIDMEM (Windows CE 5.0)

Send Feedback

This structure manages the display memory into heaps.

typedef struct _VIDMEM {DWORDdwFlags;FLATPTRfpStart;union{      FLATPTRfpEnd;      DWORDdwWidth};DDSCAPSddsCaps;DDSCAPSddsCapsAlt;union{      LPVMEMHEAPlpHeap;      DWORDdwHeight};}VIDMEM;
typedef VIDMEM FAR* LPVIDMEM;

Members

  • dwFlags
    Indicates the type of display memory.

    The following table shows the possible flags.

    Flag Description
    VIDMEM_ISHEAP Reserved for future use.
    VIDMEM_ISLINEAR Indicates linear memory.
    VIDMEM_ISNONLOCAL Indicates that the heap resides in nonlocal (AGP) memory.
    VIDMEM_ISRECTANGULAR Indicates rectangular memory.
    VIDMEM_ISWC Indicates the driver has enabled write combining on the display memory in this heap. Write combining is a special caching mode in Pentium professional-class processors that batches writes to the same cache line so they can be transferred in a single bus clock cycle. 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; for example, it specifies the last valid address in the range. Thus, the number of bytes specified by fpStart and fpEnd is (fpEnd-fpStart+1).

  • dwWidth
    Indicates the width of a memory chunk in rectangular memory.

  • ddsCaps
    DDSCAPS structure 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 VIDMEM structures. The memory allocated first is the memory that is accessed first. The VIDMEM structure 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 VIDMEM structures. 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_OFFSCREENPLAIN flag in the DDSCAPS structure. 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_OFFSCREENPLAIN flag. 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 ddsCaps and ddsCapsAlt can sometimes be eliminated.

Requirements

OS Versions: Windows CE 2.12 and later. Version 2.12 requires DXPAK 1.0 or later.
Header: Ddrawi.h.

See Also

DDSCAPS | Display Memory Structures

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.