DirectDraw

The DirectDraw API functions have been significantly improved over those found in the Game SDK. The following list briefly describes the major improvements:

·The IDirectDraw2 and IDirectDrawSurface2 interfaces were added. For more information, see IDirectDraw2 Interface and IDirectDrawSurface2 Interface.

·The following flags were added:

DDBLT_DEPTHFILL DDCAPS_BLTDEPTHFILL

DDCAPS_CANBLTSYSMEM DDCAPS_CANCLIP

DDCAPS_CANCLIPSTRETCHED DDCAPS2_NO2DDURING3DSCENE

DDEDM_REFRESHRATES DDPCAPS_1BIT

DDPCAPS_2BIT DDPF_PALETTEINDEXED1

DDPF_PALETTEINDEXED2 DDSCAPS_ALLOCONLOAD

DDSCAPS_MIPMAP DDSD_MIPMAPCOUNT

DDSD_REFRESHRATE

In addition, the name of the DDSCAPS_TEXTUREMAP flag was changed to DDSCAPS_TEXTURE and the name of the DDPF_PALETTEINDEXED4TO8 flag was changed to DDPF_PALETTEINDEXEDTO8.

·The following error messages were added:

DDERR_CANTLOCKSURFACE DDERR_CANTPAGELOCK

DDERR_CANTPAGEUNLOCK DDERR_DCALREADYCREATED

DDERR_INVALIDSURFACETYPE DDERR_NOMIPMAPHW

DDERR_NOTPAGELOCKED DDERR_NOTINITIALIZED

·The IDirectDraw2::SetDisplayMode method contains two new parameters, dwRefreshRate and dwFlags. If neither of these parameters are needed, you can still use IDirectDraw::SetDisplayMode.

·The IDirectDraw2::EnumDisplayModes method was added to enumerate the refresh rate of the monitor and store it in the dwRefreshRate member of the DDSURFACEDESC structure.

·A new method has been added to the IDirectDraw2 interface: IDirectDraw2::GetAvailableVidMem.

·Three new methods have been added to the IDirectDrawSurface2 interface: IDirectDrawSurface2::GetDDInterface, IDirectDrawSurface2::PageLock, and IDirectDrawSurface2::PageUnlock.

·DirectDraw in the Game SDK limited the available display modes to 640 by 480 with pixel depths of 8 bpp and 16 bpp. DirectDraw now allows an application to change the mode to allow any supported by the display driver.

·DirectDraw now checks the display modes it is capable of using against the display restrictions of the installed monitor. If the requested mode is not compatible with the monitor, then the IDirectDraw2::SetDisplayMode method will fail. Only modes supported on the installed monitor will be enumerated in the IDirectDraw2::EnumDisplayModes method.

·In the Game SDK, DirectDraw only allowed the creation of one DirectDraw object per process. If your process happened to use another system component, such as DirectPlay, that created a DirectDraw object, the process would be unable to create another DirectDraw object for its own use. It is now possible for a process to call the DirectDrawCreate function as many times as necessary. A unique and independent interface will be returned from each call. For more information, see Multiple DirectDraw Objects per Process.

·DirectDraw on the Game SDK required an HWND be specified in the IDirectDraw::SetCooperativeLevel method call regardless of whether or not a full-screen, exclusive mode was being requested. This method no longer requires an HWND be specified if the application is requesting DDSCL_NORMAL mode. It is now possible for an application to use DirectDraw with multiple windows. All of these windows can be used simultaneously in normal mode.

·In DirectDraw on the Game SDK, if a surface was in system memory, the hardware emulation layer (HEL) automatically performed the blit. However, some display cards have DMA hardware that allows them to efficiently blit to and from system memory surfaces. In the DirectX 2 version of DirectDraw, the DDCAPS structure has been expanded to allow drivers to report this capability. The following members have been added:

DWORD dwSVBCaps

DWORD dwSVBCKeyCaps

DWORD dwSVBFXCaps

DWORD dwSVBRops[DD_ROP_SPACE]

DWORD dwVSBCaps

DWORD dwVSBCKeyCaps

DWORD dwVSBFXCaps

DWORD dwVSBRops[DD_ROP_SPACE]

DWORD dwSSBCaps

DWORD dwSSBCKeyCaps

DWORD dwSSBFXCaps

DWORD dwSSBRops[DD_ROP_SPACE]

·In DirectDraw on the Game SDK, palettes could only be attached to the primary surface. Palettes can now be attached to any paletized surface (primary, back buffer, off-screen plain, or texture map). For more information, see Setting Palettes on Non-Primary Surfaces.

·Palettes can now be shared between multiple surfaces. For more information, see Sharing Palettes.

·In DirectDraw on the Game SDK, only 8-bit (256 entry) palettes were supported. DirectDraw on the DirectX 2 SDK supports 1-bit (2 entry), 2-bit (4 entry), and 4-bit (16 entry) palettes as well. For more information, see New Palette Types.

·Clippers can now be shared between multiple surfaces. For more information, see Sharing Clippers.

·A new API function, DirectDrawCreateClipper was added. This function allows clipper objects to be created that are not owned by a DirectDraw object. For more information, see Driver Independent Clippers.

·In DirectDraw on the Game SDK, the HEL could only create surfaces whose pixel format exactly matched that of the current primary surface. This restriction has been relaxed for the DirectX 2 version of DirectDraw. For more information, see Surface Format Support in the Hardware Emulation Layer (HEL).

·Support for surfaces specific to 3D rendering (texture maps, mipmaps, and z-buffers) has been added or enhanced in the DirectX 2 version of DirectDraw. For more information, see Texture Maps, Mipmaps, and Z-Buffers.