Partager via


IDirectDraw::GetAvailableVidMem

Send Feedback

This method retrieves the total amount of display memory available and the amount of display memory currently free for a given type of surface.

HRESULT GetAvailableVidMem( 
  LPDDSCAPS lpDDSCaps, 
  LPDWORD lpdwTotal, 
  LPDWORD lpdwFree
);

Parameters

  • lpDDSCaps
    Address of a DDSCAPS structure that indicates the hardware capabilities of the proposed surface.
  • lpdwTotal
    Address of a variable that will be filled with the total amount of display memory available, in bytes. The value retrieved reflects the total video memory, less the video memory required for the primary surface and any private caches the display driver reserves.
  • lpdwFree
    Address of a variable that will be filled with the amount of display memory currently free that can be allocated for a surface that matches the capabilities specified by the structure at lpDDSCaps.

Return Values

If the method succeeds, the return value is DD_OK.

If the method fails, the return value may be one of the following error values:

DDERR_INVALIDCAPS
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_UNSUPPORTED

If NULL is passed to either lpdwTotal or lpdwFree, the value for that parameter is not returned.

Remarks

This method provides only a snapshot of the current display-memory state.

The amount of free display memory is subject to change as surfaces are created and released. Therefore, use the free memory value only as an approximation.

In addition, a particular display adapter card may make no distinction between two different memory types.

This method might not be supported on some drivers. In this case, the method will return DDERR_UNSUPPORTED.

Requirements

Pocket PC: Windows Mobile 5.0 and later
Smartphone: Windows Mobile 5.0 and later
OS Versions: Windows CE 5.01 and later
Header: Ddraw.h.
Library: Ddraw.lib.

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.