Platform SDK: DirectX

DirectDrawCreateEx

The DirectDrawCreateEx function creates an instance of a DirectDraw object that supports the newest set of Direct3D interfaces. To use the new features of Direct3D in DirectX 7.0, create a DirectDraw object with this function. For more information about the relationship between DirectDraw and Direct3D see The DirectDraw Object and Direct3D and Accessing Direct3D topics.

HRESULT WINAPI DirectDrawCreateEx(
  GUID FAR *lpGUID,        
  LPVOID *lplpDD,          
  REFIID iid,              
  IUnknown FAR *pUnkOuter  
); 

Parameters

lpGUID
Address of the globally unique identifier (GUID) that represents the driver to be created. This can be NULL to indicate the active display driver, or you can pass one of the following flags to restrict the behavior of the active display driver for debugging purposes:
DDCREATE_EMULATIONONLY
The DirectDraw object uses emulation for all features; it does not take advantage of any hardware-supported features.
DDCREATE_HARDWAREONLY
The DirectDraw object never emulates features not supported by the hardware. Attempts to call methods that require unsupported features fail, returning DDERR_UNSUPPORTED.
lplpDD
Address of a variable to be set to a valid IDirectDraw7 interface pointer if the call succeeds.
iid
This parameter must be set to IID_IDirectDraw7. This function fails and returns DDERR_INVALIDPARAMS if any other interface is specified.
pUnkOuter
Allows for future compatibility with COM aggregation features. Presently, however, this method returns an error if this parameter is anything but NULL.

Return Values

If the function succeeds, the return value is DD_OK.

If it fails, the function can return one of the following error values:

DDERR_DIRECTDRAWALREADYCREATED
DDERR_GENERIC
DDERR_INVALIDDIRECTDRAWGUID
DDERR_INVALIDPARAMS
DDERR_NODIRECTDRAWHW
DDERR_OUTOFMEMORY

Remarks

This function attempts to initialize a DirectDraw object, and then sets a pointer to the object if the call succeeds.

On systems with multiple monitors, specifying NULL for lpGUID causes the DirectDraw object to run in emulation mode when the normal cooperative level is set. To make use of hardware acceleration on these systems, specify the device's GUID. For more information, see Devices and Acceleration in MultiMon Systems.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in ddraw.h.
  Import Library: Use ddraw.lib.