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 IDirectDraw4::EnumSurfacesmethod enumerates all of the existing or possible surfaces that meet the specified surface description.
HRESULT EnumSurfaces( DWORD dwFlags , LPDDSURFACEDESC2 lpDDSD2 , LPVOID lpContext , LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback );
Parameters
Search Type Flags | Description |
---|---|
DDENUMSURFACES_CANBECREATED | Enumerates the first surface that can be created and meets the search criterion. This flag can only be used with the DDENUMSURFACES_MATCH flag. |
DDENUMSURFACES_DOESEXIST | Enumerates the already existing surfaces that meet the search criterion. |
Matching flags | Description |
---|---|
DDENUMSURFACES_ALL | Enumerates all of the surfaces that meet the search criterion. This flag can only be used with the DDENUMSURFACES_DOESEXIST search type flag. |
DDENUMSURFACES_MATCH | Searches for any surface that matches the surface description |
DDENUMSURFACES_NOMATCH | Searches for any surface that does not match the surface description. |
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:
Remarks
If the DDENUMSURFACES_CANBECREATED flag is set, this method attempts to create a surface that temporarily meets the search criterion.
When using the DDENUMSURFACES_DOESEXIST flag, note that an enumerated surface's reference count is incremented.
If you are not going to use the surface, be sure to use IDirectDrawSurface4::Releaseto release it after each enumeration. If you will be using the surface, release it when it is no longer needed.
This method differs from its counterparts in previous interface versions in that it accepts a pointer to an EnumSurfacesCallback2function, rather than an EnumSurfacesCallbackfunction.
Requirements
Runs on | Versions | Declared in | Link to |
---|---|---|---|
Windows CE OS | 2.12 or later. Version 2.12 requires DXPAK 1.0 or later. | ddraw.h | ddraw.lib |