DirectDraw.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:262k
- (*
- * is the last flip finished?
- *)
- DDGFS_ISFLIPDONE = $00000002;
- {$EXTERNALSYM DDGFS_ISFLIPDONE}
- (****************************************************************************
- *
- * DIRECTDRAW GETBLTSTATUS FLAGS
- *
- ****************************************************************************)
- (*
- * is it OK to blt now?
- *)
- DDGBS_CANBLT = $00000001;
- {$EXTERNALSYM DDGBS_CANBLT}
- (*
- * is the blt to the surface finished?
- *)
- DDGBS_ISBLTDONE = $00000002;
- {$EXTERNALSYM DDGBS_ISBLTDONE}
- (****************************************************************************
- *
- * DIRECTDRAW ENUMOVERLAYZORDER FLAGS
- *
- ****************************************************************************)
- (*
- * Enumerate overlays back to front.
- *)
- DDENUMOVERLAYZ_BACKTOFRONT = $00000000;
- {$EXTERNALSYM DDENUMOVERLAYZ_BACKTOFRONT}
- (*
- * Enumerate overlays front to back
- *)
- DDENUMOVERLAYZ_FRONTTOBACK = $00000001;
- {$EXTERNALSYM DDENUMOVERLAYZ_FRONTTOBACK}
- (****************************************************************************
- *
- * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
- *
- ****************************************************************************)
- (*
- * Send overlay to front
- *)
- DDOVERZ_SENDTOFRONT = $00000000;
- {$EXTERNALSYM DDOVERZ_SENDTOFRONT}
- (*
- * Send overlay to back
- *)
- DDOVERZ_SENDTOBACK = $00000001;
- {$EXTERNALSYM DDOVERZ_SENDTOBACK}
- (*
- * Move Overlay forward
- *)
- DDOVERZ_MOVEFORWARD = $00000002;
- {$EXTERNALSYM DDOVERZ_MOVEFORWARD}
- (*
- * Move Overlay backward
- *)
- DDOVERZ_MOVEBACKWARD = $00000003;
- {$EXTERNALSYM DDOVERZ_MOVEBACKWARD}
- (*
- * Move Overlay in front of relative surface
- *)
- DDOVERZ_INSERTINFRONTOF = $00000004;
- {$EXTERNALSYM DDOVERZ_INSERTINFRONTOF}
- (*
- * Move Overlay in back of relative surface
- *)
- DDOVERZ_INSERTINBACKOF = $00000005;
- {$EXTERNALSYM DDOVERZ_INSERTINBACKOF}
- (****************************************************************************
- *
- * DIRECTDRAW SETGAMMARAMP FLAGS
- *
- ****************************************************************************)
- (*
- * Request calibrator to adjust the gamma ramp according to the physical
- * properties of the display so that the result should appear identical
- * on all systems.
- *)
- DDSGR_CALIBRATE = $00000001;
- {$EXTERNALSYM DDSGR_CALIBRATE}
- (****************************************************************************
- *
- * DIRECTDRAW STARTMODETEST FLAGS
- *
- ****************************************************************************)
- (*
- * Indicates that the mode being tested has passed
- *)
- DDSMT_ISTESTREQUIRED = $00000001;
- {$EXTERNALSYM DDSMT_ISTESTREQUIRED}
- (****************************************************************************
- *
- * DIRECTDRAW EVALUATEMODE FLAGS
- *
- ****************************************************************************)
- (*
- * Indicates that the mode being tested has passed
- *)
- DDEM_MODEPASSED = $00000001;
- {$EXTERNALSYM DDEM_MODEPASSED}
- (*
- * Indicates that the mode being tested has failed
- *)
- DDEM_MODEFAILED = $00000002;
- {$EXTERNALSYM DDEM_MODEFAILED}
- (*===========================================================================
- *
- *
- * DIRECTDRAW RETURN CODES
- *
- * The return values from DirectDraw Commands and Surface that return an HRESULT
- * are codes from DirectDraw concerning the results of the action
- * requested by DirectDraw.
- *
- *==========================================================================*)
- (*
- * Status is OK
- *
- * Issued by: DirectDraw Commands and all callbacks
- *)
- DD_OK = 0;
- {$EXTERNALSYM DD_OK}
- DD_FALSE = S_FALSE;
- {$EXTERNALSYM DD_FALSE}
- (****************************************************************************
- *
- * DIRECTDRAW ENUMCALLBACK RETURN VALUES
- *
- * EnumCallback returns are used to control the flow of the DIRECTDRAW and
- * DIRECTDRAWSURFACE object enumerations. They can only be returned by
- * enumeration callback routines.
- *
- ****************************************************************************)
- (*
- * stop the enumeration
- *)
- DDENUMRET_CANCEL = 0;
- {$EXTERNALSYM DDENUMRET_CANCEL}
- (*
- * continue the enumeration
- *)
- DDENUMRET_OK = 1;
- {$EXTERNALSYM DDENUMRET_OK}
- (****************************************************************************
- *
- * DIRECTDRAW ERRORS
- *
- * Errors are represented by negative values and cannot be combined.
- *
- ****************************************************************************)
- const
- _FACDD = $876;
- {$EXTERNALSYM _FACDD}
- _MAKE_DDHRESULT = HResult(1 shl 31) or HResult(_FACDD shl 16);
- //#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
- function MAKE_DDHRESULT(Code: DWORD): HResult;
- {$EXTERNALSYM MAKE_DDHRESULT}
- const
- (*
- * This object is already initialized
- *)
- DDERR_ALREADYINITIALIZED = HResult(_MAKE_DDHRESULT + 5);
- {$EXTERNALSYM DDERR_ALREADYINITIALIZED}
- (*
- * This surface can not be attached to the requested surface.
- *)
- DDERR_CANNOTATTACHSURFACE = HResult(_MAKE_DDHRESULT + 10);
- {$EXTERNALSYM DDERR_CANNOTATTACHSURFACE}
- (*
- * This surface can not be detached from the requested surface.
- *)
- DDERR_CANNOTDETACHSURFACE = HResult(_MAKE_DDHRESULT + 20);
- {$EXTERNALSYM DDERR_CANNOTDETACHSURFACE}
- (*
- * Support is currently not available.
- *)
- DDERR_CURRENTLYNOTAVAIL = HResult(_MAKE_DDHRESULT + 40);
- {$EXTERNALSYM DDERR_CURRENTLYNOTAVAIL}
- (*
- * An exception was encountered while performing the requested operation
- *)
- DDERR_EXCEPTION = HResult(_MAKE_DDHRESULT + 55);
- {$EXTERNALSYM DDERR_EXCEPTION}
- (*
- * Generic failure.
- *)
- DDERR_GENERIC = E_FAIL;
- {$EXTERNALSYM DDERR_GENERIC}
- (*
- * Height of rectangle provided is not a multiple of reqd alignment
- *)
- DDERR_HEIGHTALIGN = HResult(_MAKE_DDHRESULT + 90);
- {$EXTERNALSYM DDERR_HEIGHTALIGN}
- (*
- * Unable to match primary surface creation request with existing
- * primary surface.
- *)
- DDERR_INCOMPATIBLEPRIMARY = HResult(_MAKE_DDHRESULT + 95);
- {$EXTERNALSYM DDERR_INCOMPATIBLEPRIMARY}
- (*
- * One or more of the caps bits passed to the callback are incorrect.
- *)
- DDERR_INVALIDCAPS = HResult(_MAKE_DDHRESULT + 100);
- {$EXTERNALSYM DDERR_INVALIDCAPS}
- (*
- * DirectDraw does not support provided Cliplist.
- *)
- DDERR_INVALIDCLIPLIST = HResult(_MAKE_DDHRESULT + 110);
- {$EXTERNALSYM DDERR_INVALIDCLIPLIST}
- (*
- * DirectDraw does not support the requested mode
- *)
- DDERR_INVALIDMODE = HResult(_MAKE_DDHRESULT + 120);
- {$EXTERNALSYM DDERR_INVALIDMODE}
- (*
- * DirectDraw received a pointer that was an invalid DIRECTDRAW object.
- *)
- DDERR_INVALIDOBJECT = HResult(_MAKE_DDHRESULT + 130);
- {$EXTERNALSYM DDERR_INVALIDOBJECT}
- (*
- * One or more of the parameters passed to the callback function are
- * incorrect.
- *)
- DDERR_INVALIDPARAMS = E_INVALIDARG;
- {$EXTERNALSYM DDERR_INVALIDPARAMS}
- (*
- * pixel format was invalid as specified
- *)
- DDERR_INVALIDPIXELFORMAT = HResult(_MAKE_DDHRESULT + 145);
- {$EXTERNALSYM DDERR_INVALIDPIXELFORMAT}
- (*
- * Rectangle provided was invalid.
- *)
- DDERR_INVALIDRECT = HResult(_MAKE_DDHRESULT + 150);
- {$EXTERNALSYM DDERR_INVALIDRECT}
- (*
- * Operation could not be carried out because one or more surfaces are locked
- *)
- DDERR_LOCKEDSURFACES = HResult(_MAKE_DDHRESULT + 160);
- {$EXTERNALSYM DDERR_LOCKEDSURFACES}
- (*
- * There is no 3D present.
- *)
- DDERR_NO3D = HResult(_MAKE_DDHRESULT + 170);
- {$EXTERNALSYM DDERR_NO3D}
- (*
- * Operation could not be carried out because there is no alpha accleration
- * hardware present or available.
- *)
- DDERR_NOALPHAHW = HResult(_MAKE_DDHRESULT + 180);
- {$EXTERNALSYM DDERR_NOALPHAHW}
- (*
- * Operation could not be carried out because there is no stereo
- * hardware present or available.
- *)
- DDERR_NOSTEREOHARDWARE = HResult(_MAKE_DDHRESULT + 181);
- {$EXTERNALSYM DDERR_NOSTEREOHARDWARE}
- (*
- * Operation could not be carried out because there is no hardware
- * present which supports stereo surfaces
- *)
- DDERR_NOSURFACELEFT = HResult(_MAKE_DDHRESULT + 182);
- {$EXTERNALSYM DDERR_NOSURFACELEFT}
- (*
- * no clip list available
- *)
- DDERR_NOCLIPLIST = HResult(_MAKE_DDHRESULT + 205);
- {$EXTERNALSYM DDERR_NOCLIPLIST}
- (*
- * Operation could not be carried out because there is no color conversion
- * hardware present or available.
- *)
- DDERR_NOCOLORCONVHW = HResult(_MAKE_DDHRESULT + 210);
- {$EXTERNALSYM DDERR_NOCOLORCONVHW}
- (*
- * Create function called without DirectDraw object method SetCooperativeLevel
- * being called.
- *)
- DDERR_NOCOOPERATIVELEVELSET = HResult(_MAKE_DDHRESULT + 212);
- {$EXTERNALSYM DDERR_NOCOOPERATIVELEVELSET}
- (*
- * Surface doesn't currently have a color key
- *)
- DDERR_NOCOLORKEY = HResult(_MAKE_DDHRESULT + 215);
- {$EXTERNALSYM DDERR_NOCOLORKEY}
- (*
- * Operation could not be carried out because there is no hardware support
- * of the dest color key.
- *)
- DDERR_NOCOLORKEYHW = HResult(_MAKE_DDHRESULT + 220);
- {$EXTERNALSYM DDERR_NOCOLORKEYHW}
- (*
- * No DirectDraw support possible with current display driver
- *)
- DDERR_NODIRECTDRAWSUPPORT = HResult(_MAKE_DDHRESULT + 222);
- {$EXTERNALSYM DDERR_NODIRECTDRAWSUPPORT}
- (*
- * Operation requires the application to have exclusive mode but the
- * application does not have exclusive mode.
- *)
- DDERR_NOEXCLUSIVEMODE = HResult(_MAKE_DDHRESULT + 225);
- {$EXTERNALSYM DDERR_NOEXCLUSIVEMODE}
- (*
- * Flipping visible surfaces is not supported.
- *)
- DDERR_NOFLIPHW = HResult(_MAKE_DDHRESULT + 230);
- {$EXTERNALSYM DDERR_NOFLIPHW}
- (*
- * There is no GDI present.
- *)
- DDERR_NOGDI = HResult(_MAKE_DDHRESULT + 240);
- {$EXTERNALSYM DDERR_NOGDI}
- (*
- * Operation could not be carried out because there is no hardware present
- * or available.
- *)
- DDERR_NOMIRRORHW = HResult(_MAKE_DDHRESULT + 250);
- {$EXTERNALSYM DDERR_NOMIRRORHW}
- (*
- * Requested item was not found
- *)
- DDERR_NOTFOUND = HResult(_MAKE_DDHRESULT + 255);
- {$EXTERNALSYM DDERR_NOTFOUND}
- (*
- * Operation could not be carried out because there is no overlay hardware
- * present or available.
- *)
- DDERR_NOOVERLAYHW = HResult(_MAKE_DDHRESULT + 260);
- {$EXTERNALSYM DDERR_NOOVERLAYHW}
- (*
- * Operation could not be carried out because the source and destination
- * rectangles are on the same surface and overlap each other.
- *)
- DDERR_OVERLAPPINGRECTS = HResult(_MAKE_DDHRESULT + 270);
- {$EXTERNALSYM DDERR_OVERLAPPINGRECTS}
- (*
- * Operation could not be carried out because there is no appropriate raster
- * op hardware present or available.
- *)
- DDERR_NORASTEROPHW = HResult(_MAKE_DDHRESULT + 280);
- {$EXTERNALSYM DDERR_NORASTEROPHW}
- (*
- * Operation could not be carried out because there is no rotation hardware
- * present or available.
- *)
- DDERR_NOROTATIONHW = HResult(_MAKE_DDHRESULT + 290);
- {$EXTERNALSYM DDERR_NOROTATIONHW}
- (*
- * Operation could not be carried out because there is no hardware support
- * for stretching
- *)
- DDERR_NOSTRETCHHW = HResult(_MAKE_DDHRESULT + 310);
- {$EXTERNALSYM DDERR_NOSTRETCHHW}
- (*
- * DirectDrawSurface is not in 4 bit color palette and the requested operation
- * requires 4 bit color palette.
- *)
- DDERR_NOT4BITCOLOR = HResult(_MAKE_DDHRESULT + 316);
- {$EXTERNALSYM DDERR_NOT4BITCOLOR}
- (*
- * DirectDrawSurface is not in 4 bit color index palette and the requested
- * operation requires 4 bit color index palette.
- *)
- DDERR_NOT4BITCOLORINDEX = HResult(_MAKE_DDHRESULT + 317);
- {$EXTERNALSYM DDERR_NOT4BITCOLORINDEX}
- (*
- * DirectDraw Surface is not in 8 bit color mode and the requested operation
- * requires 8 bit color.
- *)
- DDERR_NOT8BITCOLOR = HResult(_MAKE_DDHRESULT + 320);
- {$EXTERNALSYM DDERR_NOT8BITCOLOR}
- (*
- * Operation could not be carried out because there is no texture mapping
- * hardware present or available.
- *)
- DDERR_NOTEXTUREHW = HResult(_MAKE_DDHRESULT + 330);
- {$EXTERNALSYM DDERR_NOTEXTUREHW}
- (*
- * Operation could not be carried out because there is no hardware support
- * for vertical blank synchronized operations.
- *)
- DDERR_NOVSYNCHW = HResult(_MAKE_DDHRESULT + 335);
- {$EXTERNALSYM DDERR_NOVSYNCHW}
- (*
- * Operation could not be carried out because there is no hardware support
- * for zbuffer blting.
- *)
- DDERR_NOZBUFFERHW = HResult(_MAKE_DDHRESULT + 340);
- {$EXTERNALSYM DDERR_NOZBUFFERHW}
- (*
- * Overlay surfaces could not be z layered based on their BltOrder because
- * the hardware does not support z layering of overlays.
- *)
- DDERR_NOZOVERLAYHW = HResult(_MAKE_DDHRESULT + 350);
- {$EXTERNALSYM DDERR_NOZOVERLAYHW}
- (*
- * The hardware needed for the requested operation has already been
- * allocated.
- *)
- DDERR_OUTOFCAPS = HResult(_MAKE_DDHRESULT + 360);
- {$EXTERNALSYM DDERR_OUTOFCAPS}
- (*
- * DirectDraw does not have enough memory to perform the operation.
- *)
- DDERR_OUTOFMEMORY = E_OUTOFMEMORY;
- {$EXTERNALSYM DDERR_OUTOFMEMORY}
- (*
- * DirectDraw does not have enough memory to perform the operation.
- *)
- DDERR_OUTOFVIDEOMEMORY = HResult(_MAKE_DDHRESULT + 380);
- {$EXTERNALSYM DDERR_OUTOFVIDEOMEMORY}
- (*
- * hardware does not support clipped overlays
- *)
- DDERR_OVERLAYCANTCLIP = HResult(_MAKE_DDHRESULT + 382);
- {$EXTERNALSYM DDERR_OVERLAYCANTCLIP}
- (*
- * Can only have ony color key active at one time for overlays
- *)
- DDERR_OVERLAYCOLORKEYONLYONEACTIVE = HResult(_MAKE_DDHRESULT + 384);
- {$EXTERNALSYM DDERR_OVERLAYCOLORKEYONLYONEACTIVE}
- (*
- * Access to this palette is being refused because the palette is already
- * locked by another thread.
- *)
- DDERR_PALETTEBUSY = HResult(_MAKE_DDHRESULT + 387);
- {$EXTERNALSYM DDERR_PALETTEBUSY}
- (*
- * No src color key specified for this operation.
- *)
- DDERR_COLORKEYNOTSET = HResult(_MAKE_DDHRESULT + 400);
- {$EXTERNALSYM DDERR_COLORKEYNOTSET}
- (*
- * This surface is already attached to the surface it is being attached to.
- *)
- DDERR_SURFACEALREADYATTACHED = HResult(_MAKE_DDHRESULT + 410);
- {$EXTERNALSYM DDERR_SURFACEALREADYATTACHED}
- (*
- * This surface is already a dependency of the surface it is being made a
- * dependency of.
- *)
- DDERR_SURFACEALREADYDEPENDENT = HResult(_MAKE_DDHRESULT + 420);
- {$EXTERNALSYM DDERR_SURFACEALREADYDEPENDENT}
- (*
- * Access to this surface is being refused because the surface is already
- * locked by another thread.
- *)
- DDERR_SURFACEBUSY = HResult(_MAKE_DDHRESULT + 430);
- {$EXTERNALSYM DDERR_SURFACEBUSY}
- (*
- * Access to this surface is being refused because no driver exists
- * which can supply a pointer to the surface.
- * This is most likely to happen when attempting to lock the primary
- * surface when no DCI provider is present.
- * Will also happen on attempts to lock an optimized surface.
- *)
- DDERR_CANTLOCKSURFACE = HResult(_MAKE_DDHRESULT + 435);
- {$EXTERNALSYM DDERR_CANTLOCKSURFACE}
- (*
- * Access to Surface refused because Surface is obscured.
- *)
- DDERR_SURFACEISOBSCURED = HResult(_MAKE_DDHRESULT + 440);
- {$EXTERNALSYM DDERR_SURFACEISOBSCURED}
- (*
- * Access to this surface is being refused because the surface is gone.
- * The DIRECTDRAWSURFACE object representing this surface should
- * have Restore called on it.
- *)
- DDERR_SURFACELOST = HResult(_MAKE_DDHRESULT + 450);
- {$EXTERNALSYM DDERR_SURFACELOST}
- (*
- * The requested surface is not attached.
- *)
- DDERR_SURFACENOTATTACHED = HResult(_MAKE_DDHRESULT + 460);
- {$EXTERNALSYM DDERR_SURFACENOTATTACHED}
- (*
- * Height requested by DirectDraw is too large.
- *)
- DDERR_TOOBIGHEIGHT = HResult(_MAKE_DDHRESULT + 470);
- {$EXTERNALSYM DDERR_TOOBIGHEIGHT}
- (*
- * Size requested by DirectDraw is too large -- The individual height and
- * width are OK.
- *)
- DDERR_TOOBIGSIZE = HResult(_MAKE_DDHRESULT + 480);
- {$EXTERNALSYM DDERR_TOOBIGSIZE}
- (*
- * Width requested by DirectDraw is too large.
- *)
- DDERR_TOOBIGWIDTH = HResult(_MAKE_DDHRESULT + 490);
- {$EXTERNALSYM DDERR_TOOBIGWIDTH}
- (*
- * Action not supported.
- *)
- DDERR_UNSUPPORTED = E_NOTIMPL;
- {$EXTERNALSYM DDERR_UNSUPPORTED}
- (*
- * FOURCC format requested is unsupported by DirectDraw
- *)
- DDERR_UNSUPPORTEDFORMAT = HResult(_MAKE_DDHRESULT + 510);
- {$EXTERNALSYM DDERR_UNSUPPORTEDFORMAT}
- (*
- * Bitmask in the pixel format requested is unsupported by DirectDraw
- *)
- DDERR_UNSUPPORTEDMASK = HResult(_MAKE_DDHRESULT + 520);
- {$EXTERNALSYM DDERR_UNSUPPORTEDMASK}
- (*
- * The specified stream contains invalid data
- *)
- DDERR_INVALIDSTREAM = HResult(_MAKE_DDHRESULT + 521);
- {$EXTERNALSYM DDERR_INVALIDSTREAM}
- (*
- * vertical blank is in progress
- *)
- DDERR_VERTICALBLANKINPROGRESS = HResult(_MAKE_DDHRESULT + 537);
- {$EXTERNALSYM DDERR_VERTICALBLANKINPROGRESS}
- (*
- * Informs DirectDraw that the previous Blt which is transfering information
- * to or from this Surface is incomplete.
- *)
- DDERR_WASSTILLDRAWING = HResult(_MAKE_DDHRESULT + 540);
- {$EXTERNALSYM DDERR_WASSTILLDRAWING}
- (*
- * The specified surface type requires specification of the COMPLEX flag
- *)
- DDERR_DDSCAPSCOMPLEXREQUIRED = HResult(_MAKE_DDHRESULT + 542);
- {$EXTERNALSYM DDERR_DDSCAPSCOMPLEXREQUIRED}
- (*
- * Rectangle provided was not horizontally aligned on reqd. boundary
- *)
- DDERR_XALIGN = HResult(_MAKE_DDHRESULT + 560);
- {$EXTERNALSYM DDERR_XALIGN}
- (*
- * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver
- * identifier.
- *)
- DDERR_INVALIDDIRECTDRAWGUID = HResult(_MAKE_DDHRESULT + 561);
- {$EXTERNALSYM DDERR_INVALIDDIRECTDRAWGUID}
- (*
- * A DirectDraw object representing this driver has already been created
- * for this process.
- *)
- DDERR_DIRECTDRAWALREADYCREATED = HResult(_MAKE_DDHRESULT + 562);
- {$EXTERNALSYM DDERR_DIRECTDRAWALREADYCREATED}
- (*
- * A hardware only DirectDraw object creation was attempted but the driver
- * did not support any hardware.
- *)
- DDERR_NODIRECTDRAWHW = HResult(_MAKE_DDHRESULT + 563);
- {$EXTERNALSYM DDERR_NODIRECTDRAWHW}
- (*
- * this process already has created a primary surface
- *)
- DDERR_PRIMARYSURFACEALREADYEXISTS = HResult(_MAKE_DDHRESULT + 564);
- {$EXTERNALSYM DDERR_PRIMARYSURFACEALREADYEXISTS}
- (*
- * software emulation not available.
- *)
- DDERR_NOEMULATION = HResult(_MAKE_DDHRESULT + 565);
- {$EXTERNALSYM DDERR_NOEMULATION}
- (*
- * region passed to Clipper::GetClipList is too small.
- *)
- DDERR_REGIONTOOSMALL = HResult(_MAKE_DDHRESULT + 566);
- {$EXTERNALSYM DDERR_REGIONTOOSMALL}
- (*
- * an attempt was made to set a clip list for a clipper objec that
- * is already monitoring an hwnd.
- *)
- DDERR_CLIPPERISUSINGHWND = HResult(_MAKE_DDHRESULT + 567);
- {$EXTERNALSYM DDERR_CLIPPERISUSINGHWND}
- (*
- * No clipper object attached to surface object
- *)
- DDERR_NOCLIPPERATTACHED = HResult(_MAKE_DDHRESULT + 568);
- {$EXTERNALSYM DDERR_NOCLIPPERATTACHED}
- (*
- * Clipper notification requires an HWND or
- * no HWND has previously been set as the CooperativeLevel HWND.
- *)
- DDERR_NOHWND = HResult(_MAKE_DDHRESULT + 569);
- {$EXTERNALSYM DDERR_NOHWND}
- (*
- * HWND used by DirectDraw CooperativeLevel has been subclassed,
- * this prevents DirectDraw from restoring state.
- *)
- DDERR_HWNDSUBCLASSED = HResult(_MAKE_DDHRESULT + 570);
- {$EXTERNALSYM DDERR_HWNDSUBCLASSED}
- (*
- * The CooperativeLevel HWND has already been set.
- * It can not be reset while the process has surfaces or palettes created.
- *)
- DDERR_HWNDALREADYSET = HResult(_MAKE_DDHRESULT + 571);
- {$EXTERNALSYM DDERR_HWNDALREADYSET}
- (*
- * No palette object attached to this surface.
- *)
- DDERR_NOPALETTEATTACHED = HResult(_MAKE_DDHRESULT + 572);
- {$EXTERNALSYM DDERR_NOPALETTEATTACHED}
- (*
- * No hardware support for 16 or 256 color palettes.
- *)
- DDERR_NOPALETTEHW = HResult(_MAKE_DDHRESULT + 573);
- {$EXTERNALSYM DDERR_NOPALETTEHW}
- (*
- * If a clipper object is attached to the source surface passed into a
- * BltFast call.
- *)
- DDERR_BLTFASTCANTCLIP = HResult(_MAKE_DDHRESULT + 574);
- {$EXTERNALSYM DDERR_BLTFASTCANTCLIP}
- (*
- * No blter.
- *)
- DDERR_NOBLTHW = HResult(_MAKE_DDHRESULT + 575);
- {$EXTERNALSYM DDERR_NOBLTHW}
- (*
- * No DirectDraw ROP hardware.
- *)
- DDERR_NODDROPSHW = HResult(_MAKE_DDHRESULT + 576);
- {$EXTERNALSYM DDERR_NODDROPSHW}
- (*
- * returned when GetOverlayPosition is called on a hidden overlay
- *)
- DDERR_OVERLAYNOTVISIBLE = HResult(_MAKE_DDHRESULT + 577);
- {$EXTERNALSYM DDERR_OVERLAYNOTVISIBLE}
- (*
- * returned when GetOverlayPosition is called on a overlay that UpdateOverlay
- * has never been called on to establish a destionation.
- *)
- DDERR_NOOVERLAYDEST = HResult(_MAKE_DDHRESULT + 578);
- {$EXTERNALSYM DDERR_NOOVERLAYDEST}
- (*
- * returned when the position of the overlay on the destionation is no longer
- * legal for that destionation.
- *)
- DDERR_INVALIDPOSITION = HResult(_MAKE_DDHRESULT + 579);
- {$EXTERNALSYM DDERR_INVALIDPOSITION}
- (*
- * returned when an overlay member is called for a non-overlay surface
- *)
- DDERR_NOTAOVERLAYSURFACE = HResult(_MAKE_DDHRESULT + 580);
- {$EXTERNALSYM DDERR_NOTAOVERLAYSURFACE}
- (*
- * An attempt was made to set the cooperative level when it was already
- * set to exclusive.
- *)
- DDERR_EXCLUSIVEMODEALREADYSET = HResult(_MAKE_DDHRESULT + 581);
- {$EXTERNALSYM DDERR_EXCLUSIVEMODEALREADYSET}
- (*
- * An attempt has been made to flip a surface that is not flippable.
- *)
- DDERR_NOTFLIPPABLE = HResult(_MAKE_DDHRESULT + 582);
- {$EXTERNALSYM DDERR_NOTFLIPPABLE}
- (*
- * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly
- * created.
- *)
- DDERR_CANTDUPLICATE = HResult(_MAKE_DDHRESULT + 583);
- {$EXTERNALSYM DDERR_CANTDUPLICATE}
- (*
- * Surface was not locked. An attempt to unlock a surface that was not
- * locked at all, or by this process, has been attempted.
- *)
- DDERR_NOTLOCKED = HResult(_MAKE_DDHRESULT + 584);
- {$EXTERNALSYM DDERR_NOTLOCKED}
- (*
- * Windows can not create any more DCs, or a DC was requested for a paltte-indexed
- * surface when the surface had no palette AND the display mode was not palette-indexed
- * (in this case DirectDraw cannot select a proper palette into the DC)
- *)
- DDERR_CANTCREATEDC = HResult(_MAKE_DDHRESULT + 585);
- {$EXTERNALSYM DDERR_CANTCREATEDC}
- (*
- * No DC was ever created for this surface.
- *)
- DDERR_NODC = HResult(_MAKE_DDHRESULT + 586);
- {$EXTERNALSYM DDERR_NODC}
- (*
- * This surface can not be restored because it was created in a different
- * mode.
- *)
- DDERR_WRONGMODE = HResult(_MAKE_DDHRESULT + 587);
- {$EXTERNALSYM DDERR_WRONGMODE}
- (*
- * This surface can not be restored because it is an implicitly created
- * surface.
- *)
- DDERR_IMPLICITLYCREATED = HResult(_MAKE_DDHRESULT + 588);
- {$EXTERNALSYM DDERR_IMPLICITLYCREATED}
- (*
- * The surface being used is not a palette-based surface
- *)
- DDERR_NOTPALETTIZED = HResult(_MAKE_DDHRESULT + 589);
- {$EXTERNALSYM DDERR_NOTPALETTIZED}
- (*
- * The display is currently in an unsupported mode
- *)
- DDERR_UNSUPPORTEDMODE = HResult(_MAKE_DDHRESULT + 590);
- {$EXTERNALSYM DDERR_UNSUPPORTEDMODE}
- (*
- * Operation could not be carried out because there is no mip-map
- * texture mapping hardware present or available.
- *)
- DDERR_NOMIPMAPHW = HResult(_MAKE_DDHRESULT + 591);
- {$EXTERNALSYM DDERR_NOMIPMAPHW}
- (*
- * The requested action could not be performed because the surface was of
- * the wrong type.
- *)
- DDERR_INVALIDSURFACETYPE = HResult(_MAKE_DDHRESULT + 592);
- {$EXTERNALSYM DDERR_INVALIDSURFACETYPE}
- (*
- * Device does not support optimized surfaces, therefore no video memory optimized surfaces
- *)
- DDERR_NOOPTIMIZEHW = HResult(_MAKE_DDHRESULT + 600);
- {$EXTERNALSYM DDERR_NOOPTIMIZEHW}
- (*
- * Surface is an optimized surface, but has not yet been allocated any memory
- *)
- DDERR_NOTLOADED = HResult(_MAKE_DDHRESULT + 601);
- {$EXTERNALSYM DDERR_NOTLOADED}
- (*
- * Attempt was made to create or set a device window without first setting
- * the focus window
- *)
- DDERR_NOFOCUSWINDOW = HResult(_MAKE_DDHRESULT + 602);
- {$EXTERNALSYM DDERR_NOFOCUSWINDOW}
- (*
- * Attempt was made to set a palette on a mipmap sublevel
- *)
- DDERR_NOTONMIPMAPSUBLEVEL = HResult(_MAKE_DDHRESULT + 603);
- {$EXTERNALSYM DDERR_NOTONMIPMAPSUBLEVEL}
- (*
- * A DC has already been returned for this surface. Only one DC can be
- * retrieved per surface.
- *)
- DDERR_DCALREADYCREATED = HResult(_MAKE_DDHRESULT + 620);
- {$EXTERNALSYM DDERR_DCALREADYCREATED}
- (*
- * An attempt was made to allocate non-local video memory from a device
- * that does not support non-local video memory.
- *)
- DDERR_NONONLOCALVIDMEM = HResult(_MAKE_DDHRESULT + 630);
- {$EXTERNALSYM DDERR_NONONLOCALVIDMEM}
- (*
- * The attempt to page lock a surface failed.
- *)
- DDERR_CANTPAGELOCK = HResult(_MAKE_DDHRESULT + 640);
- {$EXTERNALSYM DDERR_CANTPAGELOCK}
- (*
- * The attempt to page unlock a surface failed.
- *)
- DDERR_CANTPAGEUNLOCK = HResult(_MAKE_DDHRESULT + 660);
- {$EXTERNALSYM DDERR_CANTPAGEUNLOCK}
- (*
- * An attempt was made to page unlock a surface with no outstanding page locks.
- *)
- DDERR_NOTPAGELOCKED = HResult(_MAKE_DDHRESULT + 680);
- {$EXTERNALSYM DDERR_NOTPAGELOCKED}
- (*
- * There is more data available than the specified buffer size could hold
- *)
- DDERR_MOREDATA = HResult(_MAKE_DDHRESULT + 690);
- {$EXTERNALSYM DDERR_MOREDATA}
- (*
- * The data has expired and is therefore no longer valid.
- *)
- DDERR_EXPIRED = HResult(_MAKE_DDHRESULT + 691);
- {$EXTERNALSYM DDERR_EXPIRED}
- (*
- * The mode test has finished executing.
- *)
- DDERR_TESTFINISHED = HResult(_MAKE_DDHRESULT + 692);
- {$EXTERNALSYM DDERR_TESTFINISHED}
- (*
- * The mode test has switched to a new mode.
- *)
- DDERR_NEWMODE = HResult(_MAKE_DDHRESULT + 693);
- {$EXTERNALSYM DDERR_NEWMODE}
- (*
- * D3D has not yet been initialized.
- *)
- DDERR_D3DNOTINITIALIZED = HResult(_MAKE_DDHRESULT + 694);
- {$EXTERNALSYM DDERR_D3DNOTINITIALIZED}
- (*
- * The video port is not active
- *)
- DDERR_VIDEONOTACTIVE = HResult(_MAKE_DDHRESULT + 695);
- {$EXTERNALSYM DDERR_VIDEONOTACTIVE}
- (*
- * The monitor does not have EDID data.
- *)
- DDERR_NOMONITORINFORMATION = HResult(_MAKE_DDHRESULT + 696);
- {$EXTERNALSYM DDERR_NOMONITORINFORMATION}
- (*
- * The driver does not enumerate display mode refresh rates.
- *)
- DDERR_NODRIVERSUPPORT = HResult(_MAKE_DDHRESULT + 697);
- {$EXTERNALSYM DDERR_NODRIVERSUPPORT}
- (*
- * Surfaces created by one direct draw device cannot be used directly by
- * another direct draw device.
- *)
- DDERR_DEVICEDOESNTOWNSURFACE = HResult(_MAKE_DDHRESULT + 699);
- {$EXTERNALSYM DDERR_DEVICEDOESNTOWNSURFACE}
- (*
- * An attempt was made to invoke an interface member of a DirectDraw object
- * created by CoCreateInstance() before it was initialized.
- *)
- DDERR_NOTINITIALIZED = CO_E_NOTINITIALIZED;
- {$EXTERNALSYM DDERR_NOTINITIALIZED}
- (* Alpha bit depth constants *)
- (*
- * API's
- *)
- const
- DirectDrawDll = 'ddraw.dll';
- type
- HMonitor = THandle;
- {$EXTERNALSYM HMonitor}
- TDDEnumCallbackA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
- lpDriverName: PAnsiChar; lpContext: Pointer): BOOL; stdcall;
- {$EXTERNALSYM TDDEnumCallbackA}
- TDDEnumCallbackW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
- lpDriverName: PWideChar; lpContext: Pointer): BOOL; stdcall;
- {$EXTERNALSYM TDDEnumCallbackW}
- TDDEnumCallback = function (lpGUID: PGUID; lpDriverDescription: PChar;
- lpDriverName: PChar; lpContext: Pointer): BOOL; stdcall;
- {$EXTERNALSYM TDDEnumCallback}
- TDDEnumCallbackExA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
- lpDriverName: PAnsiChar; lpContext: Pointer; Monitor: HMonitor): BOOL;
- stdcall;
- {$EXTERNALSYM TDDEnumCallbackExA}
- TDDEnumCallbackExW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
- lpDriverName: PWideChar; lpContext: Pointer; Monitor: HMonitor): BOOL;
- stdcall;
- {$EXTERNALSYM TDDEnumCallbackExW}
- TDDEnumCallbackEx = function (lpGUID: PGUID; lpDriverDescription: PChar;
- lpDriverName: PChar; lpContext: Pointer; Monitor: HMonitor): BOOL;
- stdcall;
- {$EXTERNALSYM TDDEnumCallbackEx}
- function DirectDrawLoaded: Boolean;
- function UnLoadDirectDraw: Boolean;
- function LoadDirectDraw: Boolean;
- {$IFDEF DIRECTDRAW_DYNAMIC_LINK}
- var
- DirectDrawEnumerateA : function (lpCallback: TDDEnumCallbackA;
- lpContext: Pointer): HResult; stdcall;
- {$EXTERNALSYM DirectDrawEnumerateA}
- DirectDrawEnumerateW : function (lpCallback: TDDEnumCallbackW;
- lpContext: Pointer): HResult; stdcall;
- {$EXTERNALSYM DirectDrawEnumerateW}
- DirectDrawEnumerate : function (lpCallback: TDDEnumCallback;
- lpContext: Pointer): HResult; stdcall;
- {$EXTERNALSYM DirectDrawEnumerate}
- DirectDrawEnumerateExA : function (lpCallback: TDDEnumCallbackExA;
- lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
- {$EXTERNALSYM DirectDrawEnumerateExA}
- DirectDrawEnumerateExW : function (lpCallback: TDDEnumCallbackExW;
- lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
- {$EXTERNALSYM DirectDrawEnumerateExW}
- DirectDrawEnumerateEx : function (lpCallback: TDDEnumCallbackEx;
- lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
- {$EXTERNALSYM DirectDrawEnumerateEx}
- DirectDrawCreate : function (lpGUID: PGUID;
- out lplpDD: IDirectDraw;
- pUnkOuter: IUnknown): HResult; stdcall;
- {$EXTERNALSYM DirectDrawCreate}
- DirectDrawCreateEx : function (lpGUID: PGUID;
- out lplpDD: IDirectDraw7; const iid: TGUID;
- pUnkOuter: IUnknown): HResult; stdcall;
- {$EXTERNALSYM DirectDrawCreateEx}
- DirectDrawCreateClipper : function (dwFlags: DWORD;
- out lplpDDClipper: IDirectDrawClipper;
- pUnkOuter: IUnknown): HResult; stdcall;
- {$EXTERNALSYM DirectDrawCreateClipper}
- {$ELSE}
- function DirectDrawEnumerateA(lpCallback: TDDEnumCallbackA; lpContext: Pointer): HResult; stdcall; external DirectDrawDll;
- {$EXTERNALSYM DirectDrawEnumerateA}
- function DirectDrawEnumerateW(lpCallback: TDDEnumCallbackW; lpContext: Pointer): HResult; stdcall; external DirectDrawDll;
- {$EXTERNALSYM DirectDrawEnumerateW}
- function DirectDrawEnumerate(lpCallback: TDDEnumCallback; lpContext: Pointer): HResult; stdcall;
- external DirectDrawDll name {$IFDEF UNICODE}'DirectDrawEnumerateW'{$ELSE}'DirectDrawEnumerateA'{$ENDIF};
- {$EXTERNALSYM DirectDrawEnumerate}
- function DirectDrawEnumerateExA(lpCallback: TDDEnumCallbackExA; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall; external DirectDrawDll;
- {$EXTERNALSYM DirectDrawEnumerateExA}
- function DirectDrawEnumerateExW(lpCallback: TDDEnumCallbackExW; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall; external DirectDrawDll;
- {$EXTERNALSYM DirectDrawEnumerateExW}
- function DirectDrawEnumerateEx(lpCallback: TDDEnumCallbackEx; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
- external DirectDrawDll name {$IFDEF UNICODE}'DirectDrawEnumerateExW'{$ELSE}'DirectDrawEnumerateExA'{$ENDIF};
- {$EXTERNALSYM DirectDrawEnumerateEx}
- function DirectDrawCreate(lpGUID: PGUID; out lplpDD: IDirectDraw;
- pUnkOuter: IUnknown): HResult; stdcall; external DirectDrawDll;
- {$EXTERNALSYM DirectDrawCreate}
- function DirectDrawCreateEx(lpGUID: PGUID; out lplpDD: IDirectDraw7;
- const iid: TGUID; pUnkOuter: IUnknown): HResult; stdcall; external DirectDrawDll;
- {$EXTERNALSYM DirectDrawCreateEx}
- function DirectDrawCreateClipper(dwFlags: DWORD; out lplpDDClipper: IDirectDrawClipper;
- pUnkOuter: IUnknown): HResult; stdcall; external DirectDrawDll;
- {$EXTERNALSYM DirectDrawCreateClipper}
- {$ENDIF}
- const
- (*
- * Flags for DirectDrawEnumerateEx
- * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
- * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
- * By default, only the primary display device is enumerated.
- * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
- *)
- (*
- * This flag causes enumeration of any GDI display devices which are part of
- * the Windows Desktop
- *)
- DDENUM_ATTACHEDSECONDARYDEVICES = $00000001;
- {$EXTERNALSYM DDENUM_ATTACHEDSECONDARYDEVICES}
- (*
- * This flag causes enumeration of any GDI display devices which are not
- * part of the Windows Desktop
- *)
- DDENUM_DETACHEDSECONDARYDEVICES = $00000002;
- {$EXTERNALSYM DDENUM_DETACHEDSECONDARYDEVICES}
- (*
- * This flag causes enumeration of non-display devices
- *)
- DDENUM_NONDISPLAYDEVICES = $00000004;
- {$EXTERNALSYM DDENUM_NONDISPLAYDEVICES}
- REGSTR_KEY_DDHW_DESCRIPTION = 'Description';
- {$EXTERNALSYM REGSTR_KEY_DDHW_DESCRIPTION}
- REGSTR_KEY_DDHW_DRIVERNAME = 'DriverName';
- {$EXTERNALSYM REGSTR_KEY_DDHW_DRIVERNAME}
- REGSTR_PATH_DDHW = 'HardwareDirectDrawDrivers';
- {$EXTERNALSYM REGSTR_PATH_DDHW}
- DDCREATE_HARDWAREONLY = $00000001;
- {$EXTERNALSYM DDCREATE_HARDWAREONLY}
- DDCREATE_EMULATIONONLY = $00000002;
- {$EXTERNALSYM DDCREATE_EMULATIONONLY}
- (*
- * Flags for the IDirectDraw4::GetDeviceIdentifier method
- *)
- (*
- * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
- * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
- * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
- * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
- * of the DirectDraw object involved.
- *)
- DDGDI_GETHOSTIDENTIFIER = $00000001;
- {$EXTERNALSYM DDGDI_GETHOSTIDENTIFIER}
- (*
- * Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel
- *)
- function GET_WHQL_YEAR(dwWHQLLevel: DWORD): DWORD;
- {$EXTERNALSYM GET_WHQL_YEAR}
- function GET_WHQL_MONTH(dwWHQLLevel: DWORD): DWORD;
- {$EXTERNALSYM GET_WHQL_MONTH}
- function GET_WHQL_DAY(dwWHQLLevel: DWORD): DWORD;
- {$EXTERNALSYM GET_WHQL_DAY}
- (*==========================================================================;
- *
- * Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
- *
- * File: dvp.h
- * Content: DirectDrawVideoPort include file
- *
- ***************************************************************************)
- const
- (*
- * GUIDS used by DirectDrawVideoPort objects
- *)
- (*
- IID_IDDVideoPortContainer,
- IID_IDirectDrawVideoPort,
- IID_IDirectDrawVideoPortNotify
- - are defined later in Delphi header
- *)
- DDVPTYPE_E_HREFH_VREFH: TGUID = (D1:$54F39980;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
- {$EXTERNALSYM DDVPTYPE_E_HREFH_VREFH}
- DDVPTYPE_E_HREFH_VREFL: TGUID = (D1:$92783220;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
- {$EXTERNALSYM DDVPTYPE_E_HREFH_VREFL}
- DDVPTYPE_E_HREFL_VREFH: TGUID = (D1:$A07A02E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
- {$EXTERNALSYM DDVPTYPE_E_HREFL_VREFH}
- DDVPTYPE_E_HREFL_VREFL: TGUID = (D1:$E09C77E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
- {$EXTERNALSYM DDVPTYPE_E_HREFL_VREFL}
- DDVPTYPE_CCIR656: TGUID = (D1:$FCA326A0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
- {$EXTERNALSYM DDVPTYPE_CCIR656}
- DDVPTYPE_BROOKTREE: TGUID = (D1:$1352A560;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
- {$EXTERNALSYM DDVPTYPE_BROOKTREE}
- DDVPTYPE_PHILIPS: TGUID = (D1:$332CF160;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
- {$EXTERNALSYM DDVPTYPE_PHILIPS}
- (*
- * These definitions are required to allow polymorphic structure members (i.e. those
- * that are referred to both as DWORDs and as pointers) to resolve into a type
- * of correct size to hold the largest of those two types (i.e. pointer) on 64 bit
- * systems. For 32 bit environments, ULONG_PTR resolves to a DWORD.
- *)
- type
- ULONG_PTR = DWORD;
- {$EXTERNALSYM ULONG_PTR}
- (*============================================================================
- *
- * DirectDraw Structures
- *
- * Various structures used to invoke DirectDraw.
- *
- *==========================================================================*)
- type
- (*
- * DDVIDEOPORTCONNECT
- *)
- PDDVideoPortConnect = ^TDDVideoPortConnect;
- _DDVIDEOPORTCONNECT = packed record
- dwSize: DWORD; // size of the TDDVideoPortConnect structure
- dwPortWidth: DWORD; // Width of the video port
- guidTypeID: TGUID; // Description of video port connection
- dwFlags: DWORD; // Connection flags
- dwReserved1: ULONG_PTR; // Reserved, set to zero.
- end;
- {$EXTERNALSYM _DDVIDEOPORTCONNECT}
- DDVIDEOPORTCONNECT = _DDVIDEOPORTCONNECT;
- {$EXTERNALSYM DDVIDEOPORTCONNECT}
- TDDVideoPortConnect = _DDVIDEOPORTCONNECT;
- (*
- * DDVIDEOPORTCAPS
- *)
- PDDVideoPortCaps = ^TDDVideoPortCaps;
- _DDVIDEOPORTCAPS = packed record
- dwSize: DWORD; // size of the TDDVideoPortCaps structure
- dwFlags: DWORD; // indicates which fields contain data
- dwMaxWidth: DWORD; // max width of the video port field
- dwMaxVBIWidth: DWORD; // max width of the VBI data
- dwMaxHeight: DWORD; // max height of the video port field
- dwVideoPortID: DWORD; // Video port ID (0 - (dwMaxVideoPorts -1))
- dwCaps: DWORD; // Video port capabilities
- dwFX: DWORD; // More video port capabilities
- dwNumAutoFlipSurfaces: DWORD; // Number of autoflippable surfaces
- dwAlignVideoPortBoundary: DWORD; // Byte restriction of placement within the surface
- dwAlignVideoPortPrescaleWidth: DWORD; // Byte restriction of width after prescaling
- dwAlignVideoPortCropBoundary: DWORD; // Byte restriction of left cropping
- dwAlignVideoPortCropWidth: DWORD; // Byte restriction of cropping width
- dwPreshrinkXStep: DWORD; // Width can be shrunk in steps of 1/x
- dwPreshrinkYStep: DWORD; // Height can be shrunk in steps of 1/x
- dwNumVBIAutoFlipSurfaces: DWORD; // Number of VBI autoflippable surfaces allowed
- dwNumPreferredAutoflip: DWORD; // Optimal number of autoflippable surfaces for hardware
- wNumFilterTapsX: Word; // Number of taps the prescaler uses in the X direction (0 - no prescale, 1 - replication, etc.)
- wNumFilterTapsY: Word; // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.)
- end;
- {$EXTERNALSYM _DDVIDEOPORTCAPS}
- DDVIDEOPORTCAPS = _DDVIDEOPORTCAPS;
- {$EXTERNALSYM DDVIDEOPORTCAPS}
- TDDVideoPortCaps = _DDVIDEOPORTCAPS;
- const
- (*
- * The dwMaxWidth and dwMaxVBIWidth members are valid
- *)
- DDVPD_WIDTH = $00000001;
- {$EXTERNALSYM DDVPD_WIDTH}
- (*
- * The dwMaxHeight member is valid
- *)
- DDVPD_HEIGHT = $00000002;
- {$EXTERNALSYM DDVPD_HEIGHT}
- (*
- * The dwVideoPortID member is valid
- *)
- DDVPD_ID = $00000004;
- {$EXTERNALSYM DDVPD_ID}
- (*
- * The dwCaps member is valid
- *)
- DDVPD_CAPS = $00000008;
- {$EXTERNALSYM DDVPD_CAPS}
- (*
- * The dwFX member is valid
- *)
- DDVPD_FX = $00000010;
- {$EXTERNALSYM DDVPD_FX}
- (*
- * The dwNumAutoFlipSurfaces member is valid
- *)
- DDVPD_AUTOFLIP = $00000020;
- {$EXTERNALSYM DDVPD_AUTOFLIP}
- (*
- * All of the alignment members are valid
- *)
- DDVPD_ALIGN = $00000040;
- {$EXTERNALSYM DDVPD_ALIGN}
- (*
- * The dwNumPreferredAutoflip member is valid
- *)
- DDVPD_PREFERREDAUTOFLIP = $00000080;
- {$EXTERNALSYM DDVPD_PREFERREDAUTOFLIP}
- (*
- * The wNumFilterTapsX and wNumFilterTapsY fields are valid
- *)
- DDVPD_FILTERQUALITY = $00000100;
- {$EXTERNALSYM DDVPD_FILTERQUALITY}
- type
- (*
- * DDVIDEOPORTDESC
- *)
- PDDVideoPortDesc = ^TDDVideoPortDesc;
- _DDVIDEOPORTDESC = packed record
- dwSize: DWORD; // size of the TDDVideoPortDesc structure
- dwFieldWidth: DWORD; // width of the video port field
- dwVBIWidth: DWORD; // width of the VBI data
- dwFieldHeight: DWORD; // height of the video port field
- dwMicrosecondsPerField: DWORD; // Microseconds per video field
- dwMaxPixelsPerSecond: DWORD; // Maximum pixel rate per second
- dwVideoPortID: DWORD; // Video port ID (0 - (dwMaxVideoPorts -1))
- dwReserved1: DWORD; // Reserved for future use - set to zero (struct padding)
- VideoPortType: TDDVideoPortConnect; // Description of video port connection
- dwReserved2: DWORD; // Reserved for future use - set to zero
- dwReserved3: DWORD; // Reserved for future use - set to zero
- end;
- {$EXTERNALSYM _DDVIDEOPORTDESC}
- DDVIDEOPORTDESC = _DDVIDEOPORTDESC;
- {$EXTERNALSYM DDVIDEOPORTDESC}
- TDDVideoPortDesc = _DDVIDEOPORTDESC;
- (*
- * DDVIDEOPORTINFO
- *)
- PDDVideoPortInfo = ^TDDVideoPortInfo;
- _DDVIDEOPORTINFO = packed record
- dwSize: DWORD; // Size of the structure
- dwOriginX: DWORD; // Placement of the video data within the surface.
- dwOriginY: DWORD; // Placement of the video data within the surface.
- dwVPFlags: DWORD; // Video port options
- rCrop: TRect; // Cropping rectangle (optional).
- dwPrescaleWidth: DWORD; // Determines pre-scaling/zooming in the X direction (optional).
- dwPrescaleHeight: DWORD; // Determines pre-scaling/zooming in the Y direction (optional).
- lpddpfInputFormat: PDDPixelFormat; // Video format written to the video port
- lpddpfVBIInputFormat: PDDPixelFormat; // Input format of the VBI data
- lpddpfVBIOutputFormat: PDDPixelFormat; // Output format of the data
- dwVBIHeight: DWORD; // Specifies the number of lines of data within the vertical blanking interval.
- dwReserved1: DWORD; // Reserved for future use - set to zero
- dwReserved2: DWORD; // Reserved for future use - set to zero
- end;
- {$EXTERNALSYM _DDVIDEOPORTINFO}
- DDVIDEOPORTINFO = _DDVIDEOPORTINFO;
- {$EXTERNALSYM DDVIDEOPORTINFO}
- TDDVideoPortInfo = _DDVIDEOPORTINFO;
- (*
- * DDVIDEOPORTBANDWIDTH
- *)
- PDDVideoPortBandWidth = ^TDDVideoPortBandWidth;
- _DDVIDEOPORTBANDWIDTH = packed record
- dwSize: DWORD; // Size of the structure
- dwCaps: DWORD;
- dwOverlay: DWORD; // Zoom factor at which overlay is supported
- dwColorkey: DWORD; // Zoom factor at which overlay w/ colorkey is supported
- dwYInterpolate: DWORD; // Zoom factor at which overlay w/ Y interpolation is supported
- dwYInterpAndColorkey: DWORD; // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
- dwReserved1: DWORD; // Reserved for future use - set to zero
- dwReserved2: DWORD; // Reserved for future use - set to zero
- end;
- {$EXTERNALSYM _DDVIDEOPORTBANDWIDTH}
- DDVIDEOPORTBANDWIDTH = _DDVIDEOPORTBANDWIDTH;
- {$EXTERNALSYM DDVIDEOPORTBANDWIDTH}
- TDDVideoPortBandWidth = _DDVIDEOPORTBANDWIDTH;
- (*
- * DDVIDEOPORTSTATUS
- *)
- PDDVideoPortStatus = ^TDDVideoPortStatus;
- _DDVIDEOPORTSTATUS = record
- dwSize: DWORD; // Size of the structure
- bInUse: BOOL; // TRUE if video port is currently being used
- dwFlags: DWORD; // Currently not used
- dwReserved1: DWORD; // Reserved for future use
- VideoPortType: TDDVideoPortConnect; // Information about the connection
- dwReserved2: DWORD; // Reserved for future use
- dwReserved3: DWORD; // Reserved for future use
- end;
- {$EXTERNALSYM _DDVIDEOPORTSTATUS}
- DDVIDEOPORTSTATUS = _DDVIDEOPORTSTATUS;
- {$EXTERNALSYM DDVIDEOPORTSTATUS}
- TDDVideoPortStatus = _DDVIDEOPORTSTATUS;
- (*
- * DDVIDEOPORTNOTIFY
- *)
- PDDVideoPortNotify = ^TDDVideoPortNotify;
- _DDVIDEOPORTNOTIFY = packed record
- ApproximateTimeStamp: Int64; // Timestamp in the event notification
- lField: Longint; // 0 if even, 1 if odd, -1 if unknown
- dwSurfaceIndex: Longword; // Index in the surface chain of the surface that received the sample
- lDone: Longint; // Call InterlockedIncrement on this when done with sample
- end;
- {$EXTERNALSYM _DDVIDEOPORTNOTIFY}
- DDVIDEOPORTNOTIFY = _DDVIDEOPORTNOTIFY;
- {$EXTERNALSYM DDVIDEOPORTNOTIFY}
- TDDVideoPortNotify = _DDVIDEOPORTNOTIFY;
- (*============================================================================
- *
- * Video Port Flags
- *
- * All flags are bit flags.
- *
- *==========================================================================*)
- const
- (****************************************************************************
- *
- * VIDEOPORT DDVIDEOPORTCONNECT / TDDVideoPortConnect FLAGS
- *
- ****************************************************************************)
- (*
- * When this is set by the driver and passed to the client, this
- * indicates that the video port is capable of double clocking the data.
- * When this is set by the client, this indicates that the video port
- * should enable double clocking. This flag is only valid with external
- * syncs.
- *)
- DDVPCONNECT_DOUBLECLOCK = $00000001;
- {$EXTERNALSYM DDVPCONNECT_DOUBLECLOCK}
- (*
- * When this is set by the driver and passed to the client, this
- * indicates that the video port is capable of using an external VACT
- * signal. When this is set by the client, this indicates that the
- * video port should use the external VACT signal.
- *)
- DDVPCONNECT_VACT = $00000002;
- {$EXTERNALSYM DDVPCONNECT_VACT}
- (*
- * When this is set by the driver and passed to the client, this
- * indicates that the video port is capable of treating even fields
- * like odd fields and visa versa. When this is set by the client,
- * this indicates that the video port should treat even fields like odd
- * fields.
- *)
- DDVPCONNECT_INVERTPOLARITY = $00000004;
- {$EXTERNALSYM DDVPCONNECT_INVERTPOLARITY}
- (*
- * Indicates that any data written to the video port during the VREF
- * period will not be written into the frame buffer. This flag is read only.
- *)
- DDVPCONNECT_DISCARDSVREFDATA = $00000008;
- {$EXTERNALSYM DDVPCONNECT_DISCARDSVREFDATA}
- (*
- * When this is set be the driver and passed to the client, this
- * indicates that the device will write half lines into the frame buffer
- * if half lines are provided by the decoder. If this is set by the client,
- * this indicates that the decoder will be supplying half lines.
- *)
- DDVPCONNECT_HALFLINE = $00000010;
- {$EXTERNALSYM DDVPCONNECT_HALFLINE}
- (*
- * Indicates that the signal is interlaced. This flag is only
- * set by the client.
- *)
- DDVPCONNECT_INTERLACED = $00000020;
- {$EXTERNALSYM DDVPCONNECT_INTERLACED}
- (*
- * Indicates that video port is shareable and that this video port
- * will use the even fields. This flag is only set by the client.
- *)
- DDVPCONNECT_SHAREEVEN = $00000040;
- {$EXTERNALSYM DDVPCONNECT_SHAREEVEN}
- (*
- * Indicates that video port is shareable and that this video port
- * will use the odd fields. This flag is only set by the client.
- *)
- DDVPCONNECT_SHAREODD = $00000080;
- {$EXTERNALSYM DDVPCONNECT_SHAREODD}
- (****************************************************************************
- *
- * VIDEOPORT DDVIDEOPORTDESC / TDDVideoPortDesc CAPS
- *
- ****************************************************************************)
- (*
- * Flip can be performed automatically to avoid tearing.
- *)
- DDVPCAPS_AUTOFLIP = $00000001;
- {$EXTERNALSYM DDVPCAPS_AUTOFLIP}
- (*
- * Supports interlaced video
- *)
- DDVPCAPS_INTERLACED = $00000002;
- {$EXTERNALSYM DDVPCAPS_INTERLACED}
- (*
- * Supports non-interlaced video
- *)
- DDVPCAPS_NONINTERLACED = $00000004;
- {$EXTERNALSYM DDVPCAPS_NONINTERLACED}
- (*
- * Indicates that the device can return whether the current field
- * of an interlaced signal is even or odd.
- *)
- DDVPCAPS_READBACKFIELD = $00000008;
- {$EXTERNALSYM DDVPCAPS_READBACKFIELD}
- (*
- * Indicates that the device can return the current line of video
- * being written into the frame buffer.
- *)
- DDVPCAPS_READBACKLINE = $00000010;
- {$EXTERNALSYM DDVPCAPS_READBACKLINE}
- (*
- * Allows two gen-locked video streams to share a single video port,
- * where one stream uses the even fields and the other uses the odd
- * fields. Separate parameters (including address, scaling,
- * cropping, etc.) are maintained for both fields.)
- *)
- DDVPCAPS_SHAREABLE = $00000020;
- {$EXTERNALSYM DDVPCAPS_SHAREABLE}
- (*
- * Even fields of video can be automatically discarded.
- *)
- DDVPCAPS_SKIPEVENFIELDS = $00000040;
- {$EXTERNALSYM DDVPCAPS_SKIPEVENFIELDS}
- (*
- * Odd fields of video can be automatically discarded.
- *)
- DDVPCAPS_SKIPODDFIELDS = $00000080;
- {$EXTERNALSYM DDVPCAPS_SKIPODDFIELDS}
- (*
- * Indicates that the device is capable of driving the graphics
- * VSYNC with the video port VSYNC.
- *)
- DDVPCAPS_SYNCMASTER = $00000100;
- {$EXTERNALSYM DDVPCAPS_SYNCMASTER}
- (*
- * Indicates that data within the vertical blanking interval can
- * be written to a different surface.
- *)
- DDVPCAPS_VBISURFACE = $00000200;
- {$EXTERNALSYM DDVPCAPS_VBISURFACE}
- (*
- * Indicates that the video port can perform color operations
- * on the incoming data before it is written to the frame buffer.
- *)
- DDVPCAPS_COLORCONTROL = $00000400;
- {$EXTERNALSYM DDVPCAPS_COLORCONTROL}
- (*
- * Indicates that the video port can accept VBI data in a different
- * width or format than the regular video data.
- *)
- DDVPCAPS_OVERSAMPLEDVBI = $00000800;
- {$EXTERNALSYM DDVPCAPS_OVERSAMPLEDVBI}
- (*
- * Indicates that the video port can write data directly to system memory
- *)
- DDVPCAPS_SYSTEMMEMORY = $00001000;
- {$EXTERNALSYM DDVPCAPS_SYSTEMMEMORY}
- (*
- * Indicates that the VBI and video portions of the video stream can
- * be controlled by an independent processes.
- *)
- DDVPCAPS_VBIANDVIDEOINDEPENDENT = $00002000;
- {$EXTERNALSYM DDVPCAPS_VBIANDVIDEOINDEPENDENT}
- (*
- * Indicates that the video port contains high quality hardware
- * de-interlacing hardware that should be used instead of the
- * bob/weave algorithms.
- *)
- DDVPCAPS_HARDWAREDEINTERLACE = $00004000;
- {$EXTERNALSYM DDVPCAPS_HARDWAREDEINTERLACE}
- (****************************************************************************
- *
- * VIDEOPORT DDVIDEOPORTDESC / TDDVideoPortDesc FX
- *
- ****************************************************************************)
- (*
- * Limited cropping is available to crop out the vertical interval data.
- *)
- DDVPFX_CROPTOPDATA = $00000001;
- {$EXTERNALSYM DDVPFX_CROPTOPDATA}
- (*
- * Incoming data can be cropped in the X direction before it is written
- * to the surface.
- *)
- DDVPFX_CROPX = $00000002;
- {$EXTERNALSYM DDVPFX_CROPX}
- (*
- * Incoming data can be cropped in the Y direction before it is written
- * to the surface.
- *)
- DDVPFX_CROPY = $00000004;
- {$EXTERNALSYM DDVPFX_CROPY}
- (*
- * Supports interleaving interlaced fields in memory.
- *)
- DDVPFX_INTERLEAVE = $00000008;
- {$EXTERNALSYM DDVPFX_INTERLEAVE}
- (*
- * Supports mirroring left to right as the video data is written
- * into the frame buffer.
- *)
- DDVPFX_MIRRORLEFTRIGHT = $00000010;
- {$EXTERNALSYM DDVPFX_MIRRORLEFTRIGHT}
- (*
- * Supports mirroring top to bottom as the video data is written
- * into the frame buffer.
- *)
- DDVPFX_MIRRORUPDOWN = $00000020;
- {$EXTERNALSYM DDVPFX_MIRRORUPDOWN}
- (*
- * Data can be arbitrarily shrunk in the X direction before it
- * is written to the surface.
- *)
- DDVPFX_PRESHRINKX = $00000040;
- {$EXTERNALSYM DDVPFX_PRESHRINKX}
- (*
- * Data can be arbitrarily shrunk in the Y direction before it
- * is written to the surface.
- *)
- DDVPFX_PRESHRINKY = $00000080;
- {$EXTERNALSYM DDVPFX_PRESHRINKY}
- (*
- * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
- * direction before it is written to the surface.
- *)
- DDVPFX_PRESHRINKXB = $00000100;
- {$EXTERNALSYM DDVPFX_PRESHRINKXB}
- (*
- * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
- * direction before it is written to the surface.
- *)
- DDVPFX_PRESHRINKYB = $00000200;
- {$EXTERNALSYM DDVPFX_PRESHRINKYB}
- (*
- * Data can be shrunk in increments of 1/x in the X direction
- * (where X is specified in the TDDVideoPortCaps.dwPreshrinkXStep)
- * before it is written to the surface.
- *)
- DDVPFX_PRESHRINKXS = $00000400;
- {$EXTERNALSYM DDVPFX_PRESHRINKXS}
- (*
- * Data can be shrunk in increments of 1/x in the Y direction
- * (where X is specified in the TDDVideoPortCaps.dwPreshrinkYStep)
- * before it is written to the surface.
- *)
- DDVPFX_PRESHRINKYS = $00000800;
- {$EXTERNALSYM DDVPFX_PRESHRINKYS}
- (*
- * Data can be arbitrarily stretched in the X direction before
- * it is written to the surface.
- *)
- DDVPFX_PRESTRETCHX = $00001000;
- {$EXTERNALSYM DDVPFX_PRESTRETCHX}
- (*
- * Data can be arbitrarily stretched in the Y direction before
- * it is written to the surface.
- *)
- DDVPFX_PRESTRETCHY = $00002000;
- {$EXTERNALSYM DDVPFX_PRESTRETCHY}
- (*
- * Data can be integer stretched in the X direction before it is
- * written to the surface.
- *)
- DDVPFX_PRESTRETCHXN = $00004000;
- {$EXTERNALSYM DDVPFX_PRESTRETCHXN}
- (*
- * Data can be integer stretched in the Y direction before it is
- * written to the surface.
- *)
- DDVPFX_PRESTRETCHYN = $00008000;
- {$EXTERNALSYM DDVPFX_PRESTRETCHYN}
- (*
- * Indicates that data within the vertical blanking interval can
- * be converted independently of the remaining video data.
- *)
- DDVPFX_VBICONVERT = $00010000;
- {$EXTERNALSYM DDVPFX_VBICONVERT}
- (*
- * Indicates that scaling can be disabled for data within the
- * vertical blanking interval.
- *)
- DDVPFX_VBINOSCALE = $00020000;
- {$EXTERNALSYM DDVPFX_VBINOSCALE}
- (*
- * Indicates that the video data can ignore the left and right
- * cropping coordinates when cropping oversampled VBI data.
- *)
- DDVPFX_IGNOREVBIXCROP = $00040000;
- {$EXTERNALSYM DDVPFX_IGNOREVBIXCROP}
- (*
- * Indicates that interleaving can be disabled for data within the
- * vertical blanking interval.
- *)
- DDVPFX_VBINOINTERLEAVE = $00080000;
- {$EXTERNALSYM DDVPFX_VBINOINTERLEAVE}
- (****************************************************************************
- *
- * VIDEOPORT DDVIDEOPORTINFO / TDDVideoPortInfo FLAGS
- *
- ****************************************************************************)
- (*
- * Perform automatic flipping. Auto-flipping is performed between
- * the overlay surface that was attached to the video port using
- * IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
- * are attached to the surface via the IDirectDrawSurface::AttachSurface
- * method. The flip order is the order in which the overlay surfaces
- * were. attached.
- *)
- DDVP_AUTOFLIP = $00000001;
- {$EXTERNALSYM DDVP_AUTOFLIP}
- (*
- * Perform conversion using the ddpfOutputFormat information.
- *)
- DDVP_CONVERT = $00000002;
- {$EXTERNALSYM DDVP_CONVERT}
- (*
- * Perform cropping using the specified rectangle.
- *)
- DDVP_CROP = $00000004;
- {$EXTERNALSYM DDVP_CROP}
- (*
- * Indicates that interlaced fields should be interleaved in memory.
- *)
- DDVP_INTERLEAVE = $00000008;
- {$EXTERNALSYM DDVP_INTERLEAVE}
- (*
- * Indicates that the data should be mirrored left to right as it's
- * written into the frame buffer.
- *)
- DDVP_MIRRORLEFTRIGHT = $00000010;
- {$EXTERNALSYM DDVP_MIRRORLEFTRIGHT}
- (*
- * Indicates that the data should be mirrored top to bottom as it's
- * written into the frame buffer.
- *)
- DDVP_MIRRORUPDOWN = $00000020;
- {$EXTERNALSYM DDVP_MIRRORUPDOWN}
- (*
- * Perform pre-scaling/zooming based on the pre-scale parameters.
- *)
- DDVP_PRESCALE = $00000040;
- {$EXTERNALSYM DDVP_PRESCALE}
- (*
- * Ignore input of even fields.
- *)
- DDVP_SKIPEVENFIELDS = $00000080;
- {$EXTERNALSYM DDVP_SKIPEVENFIELDS}
- (*
- * Ignore input of odd fields.
- *)
- DDVP_SKIPODDFIELDS = $00000100;
- {$EXTERNALSYM DDVP_SKIPODDFIELDS}
- (*
- * Drive the graphics VSYNCs using the video port VYSNCs.
- *)
- DDVP_SYNCMASTER = $00000200;
- {$EXTERNALSYM DDVP_SYNCMASTER}
- (*
- * The ddpfVBIOutputFormatFormat member contains data that should be used
- * to convert the data within the vertical blanking interval.
- *)
- DDVP_VBICONVERT = $00000400;
- {$EXTERNALSYM DDVP_VBICONVERT}
- (*
- * Indicates that data within the vertical blanking interval
- * should not be scaled.
- *)
- DDVP_VBINOSCALE = $00000800;
- {$EXTERNALSYM DDVP_VBINOSCALE}
- (*
- * Indicates that these bob/weave decisions should not be
- * overriden by other interfaces.
- *)
- DDVP_OVERRIDEBOBWEAVE = $00001000;
- {$EXTERNALSYM DDVP_OVERRIDEBOBWEAVE}
- (*
- * Indicates that the video data should ignore the left and right
- * cropping coordinates when cropping the VBI data.
- *)
- DDVP_IGNOREVBIXCROP = $00002000;
- {$EXTERNALSYM DDVP_IGNOREVBIXCROP}
- (*
- * Indicates that interleaving can be disabled for data within the
- * vertical blanking interval.
- *)
- DDVP_VBINOINTERLEAVE = $00004000;
- {$EXTERNALSYM DDVP_VBINOINTERLEAVE}
- (*
- * Indicates that the video port should use the hardware
- * de-interlacing hardware.
- *)
- DDVP_HARDWAREDEINTERLACE = $00008000;
- {$EXTERNALSYM DDVP_HARDWAREDEINTERLACE}
- (****************************************************************************
- *
- * DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
- *
- ****************************************************************************)
- (*
- * Return formats for the video data
- *)
- DDVPFORMAT_VIDEO = $00000001;
- {$EXTERNALSYM DDVPFORMAT_VIDEO}
- (*
- * Return formats for the VBI data
- *)
- DDVPFORMAT_VBI = $00000002;
- {$EXTERNALSYM DDVPFORMAT_VBI}
- (****************************************************************************
- *
- * DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
- *
- ****************************************************************************)
- (*
- * Surface should receive video data (and VBI data if a surface
- * is not explicitly attached for that purpose)
- *)
- DDVPTARGET_VIDEO = $00000001;
- {$EXTERNALSYM DDVPTARGET_VIDEO}
- (*
- * Surface should receive VBI data
- *)
- DDVPTARGET_VBI = $00000002;
- {$EXTERNALSYM DDVPTARGET_VBI}
- (****************************************************************************
- *
- * DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
- *
- ****************************************************************************)
- (*
- * Waits until the beginning of the next VSYNC
- *)
- DDVPWAIT_BEGIN = $00000001;
- {$EXTERNALSYM DDVPWAIT_BEGIN}
- (*
- * Waits until the end of the next/current VSYNC
- *)
- DDVPWAIT_END = $00000002;
- {$EXTERNALSYM DDVPWAIT_END}
- (*
- * Waits until the beginning of the specified line
- *)
- DDVPWAIT_LINE = $00000003;
- {$EXTERNALSYM DDVPWAIT_LINE}
- (****************************************************************************
- *
- * DIRECTDRAWVIDEOPORT FLIP FLAGS
- *
- ****************************************************************************)
- (*
- * Flips the normal video surface
- *)
- DDVPFLIP_VIDEO = $00000001;
- {$EXTERNALSYM DDVPFLIP_VIDEO}
- (*
- * Flips the VBI surface
- *)
- DDVPFLIP_VBI = $00000002;
- {$EXTERNALSYM DDVPFLIP_VBI}
- (****************************************************************************
- *
- * DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
- *
- ****************************************************************************)
- (*
- * No video signal is present at the video port
- *)
- DDVPSQ_NOSIGNAL = $00000001;
- {$EXTERNALSYM DDVPSQ_NOSIGNAL}
- (*
- * A valid video signal is present at the video port
- *)
- DDVPSQ_SIGNALOK = $00000002;
- {$EXTERNALSYM DDVPSQ_SIGNALOK}
- (****************************************************************************
- *
- * VIDEOPORTBANDWIDTH Flags
- *
- ****************************************************************************)
- (*
- * The specified height/width refer to the size of the video port data
- * written into memory, after prescaling has occured.
- *)
- DDVPB_VIDEOPORT = $00000001;
- {$EXTERNALSYM DDVPB_VIDEOPORT}
- (*
- * The specified height/width refer to the source size of the overlay.
- *)
- DDVPB_OVERLAY = $00000002;
- {$EXTERNALSYM DDVPB_OVERLAY}
- (*
- * This is a query for the device to return which caps this device requires.
- *)
- DDVPB_TYPE = $00000004;
- {$EXTERNALSYM DDVPB_TYPE}
- (****************************************************************************
- *
- * VIDEOPORTBANDWIDTH Caps
- *
- ****************************************************************************)
- (*
- * The bandwidth for this device is dependant on the overlay source size.
- *)
- DDVPBCAPS_SOURCE = $00000001;
- {$EXTERNALSYM DDVPBCAPS_SOURCE}
- (*
- * The bandwidth for this device is dependant on the overlay destination
- * size.
- *)
- DDVPBCAPS_DESTINATION = $00000002;
- {$EXTERNALSYM DDVPBCAPS_DESTINATION}
- (****************************************************************************
- *
- * DDVIDEOPORTCONTAINER CreateVideoPort flags
- *
- ****************************************************************************)
- (*
- * The process only wants to control the VBI portion of the video stream.
- *)
- DDVPCREATE_VBIONLY = $00000001;
- {$EXTERNALSYM DDVPCREATE_VBIONLY}
- (*
- * The process only wants to control the non-VBI (video) portion of
- * the video stream.
- *)
- DDVPCREATE_VIDEOONLY = $00000002;
- {$EXTERNALSYM DDVPCREATE_VIDEOONLY}
- (****************************************************************************
- *
- * DDVIDEOPORTSTATUS flags
- *
- ****************************************************************************)
- (*
- * The video port interface is only controlling the VBI portion of the
- * video stream
- *)
- DDVPSTATUS_VBIONLY = $00000001;
- {$EXTERNALSYM DDVPSTATUS_VBIONLY}
- (*
- * The video port interface is only controlling the video portion of the
- * video stream
- *)
- DDVPSTATUS_VIDEOONLY = $00000002;
- {$EXTERNALSYM DDVPSTATUS_VIDEOONLY}
- type
- (*
- * API's
- *)
- TDDEnumVideoCallback = function (lpTDDVideoPortCaps: PDDVideoPortCaps;
- lpContext: Pointer): HResult; stdcall;
- {$EXTERNALSYM TDDEnumVideoCallback}
- (*
- * INTERACES FOLLOW:
- * IDirectDrawVideoPort
- * IVideoPort
- *)
- IDirectDrawVideoPort = interface;
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawVideoPort);'}
- {$EXTERNALSYM IDirectDrawVideoPort}
- (*
- * IDirectDrawVideoPortContainer
- *)
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDDVideoPortContainer);'}
- {$EXTERNALSYM IDDVideoPortContainer}
- IDDVideoPortContainer = interface(IUnknown)
- ['{6C142760-A733-11CE-A521-0020AF0BE560}']
- (*** IDDVideoPortContainer methods ***)
- function CreateVideoPort(dwFlags: DWORD; var lpTDDVideoPortDesc:
- TDDVideoPortDesc; var lplpDDVideoPort: IDirectDrawVideoPort;
- pUnkOuter: IUnknown): HResult; stdcall;
- function EnumVideoPorts(dwFlags: DWORD;
- lpTDDVideoPortCaps: PDDVideoPortCaps; lpContext: Pointer;
- lpEnumVideoCallback: TDDEnumVideoCallback): HResult; stdcall;
- function GetVideoPortConnectInfo(dwPortId: DWORD; var lpNumEntries: DWORD;
- lpConnectInfo: PDDVideoPortConnect): HResult; stdcall;
- function QueryVideoPortStatus(dwPortId: DWORD;
- var lpVPStatus: TDDVideoPortStatus): HResult; stdcall;
- end;
- (*
- * IDirectDrawVideoPort
- *)
- IDirectDrawVideoPort = interface(IUnknown)
- ['{B36D93E0-2B43-11CF-A2DE-00AA00B93356}']
- (*** IDirectDrawVideoPort methods ***)
- function Flip(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD): HResult; stdcall;
- function GetBandwidthInfo(var lpddpfFormat: TDDPixelFormat;
- dwWidth: DWORD; dwHeight: DWORD; dwFlags: DWORD;
- var lpBandwidth: TDDVideoPortBandWidth): HResult; stdcall;
- function GetColorControls(var lpColorControl: TDDColorControl): HResult; stdcall;
- function GetInputFormats(var lpNumFormats: DWORD; var lpFormats:
- TDDPixelFormat; dwFlags: DWORD): HResult; stdcall;
- function GetOutputFormats(var lpInputFormat: TDDPixelFormat;
- var lpNumFormats: DWORD; lpFormats: PDDPixelFormat; dwFlags: DWORD):
- HResult; stdcall;
- function GetFieldPolarity(var lpbVideoField: BOOL): HResult; stdcall;
- function GetVideoLine(var lpdwLine: DWORD): HResult; stdcall;
- function GetVideoSignalStatus(varlpdwStatus: DWORD): HResult; stdcall;
- function SetColorControls(var lpColorControl: TDDColorControl): HResult; stdcall;
- function SetTargetSurface(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD):
- HResult; stdcall;
- function StartVideo(var lpVideoInfo: TDDVideoPortInfo): HResult; stdcall;
- function StopVideo: HResult; stdcall;
- function UpdateVideo(var lpVideoInfo: TDDVideoPortInfo): HResult; stdcall;
- function WaitForSync(dwFlags: DWORD; dwLine: DWORD; dwTimeout: DWORD):
- HResult; stdcall;
- end;
- IID_IDDVideoPortContainer = IDDVideoPortContainer;
- {$EXTERNALSYM IID_IDDVideoPortContainer}
- IID_IDirectDrawVideoPort = IDirectDrawVideoPort;
- {$EXTERNALSYM IID_IDirectDrawVideoPort}
- (*
- * IDirectDrawVideoPort
- *)
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawVideoPortNotify);'}
- {$EXTERNALSYM IDirectDrawVideoPortNotify}
- IDirectDrawVideoPortNotify = interface(IUnknown)
- ['{6C142760-A733-11CE-A521-0020AF0BE560}']
- (*** IVideoPort methods ***)
- function AcquireNotification(hEvent: THandle; const params: TDDVideoPortNotify): HResult; stdcall;
- function ReleaseNotification(hEvent: THandle): HResult; stdcall;
- end;
- var
- DDrawDLL : HMODULE = 0;
- function DDErrorString(Value: HResult): String;
- implementation
- //#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
- function MAKE_DDHRESULT(Code: DWORD): HResult;
- begin
- Result:= MakeResult(1, _FACDD, code);
- end;
- //#define GET_WHQL_YEAR( dwWHQLLevel )
- // ( (dwWHQLLevel) / 0x10000 )
- function GET_WHQL_YEAR(dwWHQLLevel: DWORD): DWORD;
- begin
- Result := (dwWHQLLevel) div $10000;
- end;
- //#define GET_WHQL_MONTH( dwWHQLLevel )
- // ( ( (dwWHQLLevel) / 0x100 ) & 0x00ff )
- function GET_WHQL_MONTH(dwWHQLLevel: DWORD): DWORD;
- begin
- Result := ((dwWHQLLevel) div $100) and $00ff;
- end;
- //#define GET_WHQL_DAY( dwWHQLLevel )
- // ( (dwWHQLLevel) & 0xff )
- function GET_WHQL_DAY(dwWHQLLevel: DWORD): DWORD;
- begin
- Result := (dwWHQLLevel) and $ff;
- end;
- function MAKEFOURCC(ch0, ch1, ch2, ch3: Char): DWORD;
- begin
- Result := DWORD(Byte(ch0) shl 0) or
- DWORD(Byte(ch1) shl 8) or
- DWORD(Byte(ch2) shl 16) or
- DWORD(Byte(ch3) shl 24);
- end;
- function DDErrorString(Value: HResult): String;
- begin
- case Value of
- DD_OK: Result := 'The request completed successfully.';
- DDERR_ALREADYINITIALIZED: Result := 'This object is already initialized.';
- DDERR_BLTFASTCANTCLIP: Result := ' if a clipper object is attached to the source surface passed into a BltFast call.';
- DDERR_CANNOTATTACHSURFACE: Result := 'This surface can not be attached to the requested surface.';
- DDERR_CANNOTDETACHSURFACE: Result := 'This surface can not be detached from the requested surface.';
- DDERR_CANTCREATEDC: Result := 'Windows can not create any more DCs.';
- DDERR_CANTDUPLICATE: Result := 'Cannot duplicate primary & 3D surfaces, or surfaces that are implicitly created.';
- DDERR_CLIPPERISUSINGHWND: Result := 'An attempt was made to set a cliplist for a clipper object that is already monitoring an hwnd.';
- DDERR_COLORKEYNOTSET: Result := 'No src color key specified for this operation.';
- DDERR_CURRENTLYNOTAVAIL: Result := 'Support is currently not available.';
- DDERR_DIRECTDRAWALREADYCREATED: Result := 'A DirectDraw object representing this driver has already been created for this process.';
- DDERR_EXCEPTION: Result := 'An exception was encountered while performing the requested operation.';
- DDERR_EXCLUSIVEMODEALREADYSET: Result := 'An attempt was made to set the cooperative level when it was already set to exclusive.';
- DDERR_GENERIC: Result := 'Generic failure.';
- DDERR_HEIGHTALIGN: Result := 'Height of rectangle provided is not a multiple of reqd alignment.';
- DDERR_HWNDALREADYSET: Result := 'The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or palettes created.';
- DDERR_HWNDSUBCLASSED: Result := 'HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring state.';
- DDERR_IMPLICITLYCREATED: Result := 'This surface can not be restored because it is an implicitly created surface.';
- DDERR_INCOMPATIBLEPRIMARY: Result := 'Unable to match primary surface creation request with existing primary surface.';
- DDERR_INVALIDCAPS: Result := 'One or more of the caps bits passed to the callback are incorrect.';
- DDERR_INVALIDCLIPLIST: Result := 'DirectDraw does not support the provided cliplist.';
- DDERR_INVALIDDIRECTDRAWGUID: Result := 'The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.';
- DDERR_INVALIDMODE: Result := 'DirectDraw does not support the requested mode.';
- DDERR_INVALIDOBJECT: Result := 'DirectDraw received a pointer that was an invalid DIRECTDRAW object.';
- DDERR_INVALIDPARAMS: Result := 'One or more of the parameters passed to the function are incorrect.';
- DDERR_INVALIDPIXELFORMAT: Result := 'The pixel format was invalid as specified.';
- DDERR_INVALIDPOSITION: Result := 'Returned when the position of the overlay on the destination is no longer legal for that destination.';
- DDERR_INVALIDRECT: Result := 'Rectangle provided was invalid.';
- DDERR_LOCKEDSURFACES: Result := 'Operation could not be carried out because one or more surfaces are locked.';
- DDERR_NO3D: Result := 'There is no 3D present.';
- DDERR_NOALPHAHW: Result := 'Operation could not be carried out because there is no alpha accleration hardware present or available.';
- DDERR_NOBLTHW: Result := 'No blitter hardware present.';
- DDERR_NOCLIPLIST: Result := 'No cliplist available.';
- DDERR_NOCLIPPERATTACHED: Result := 'No clipper object attached to surface object.';
- DDERR_NOCOLORCONVHW: Result := 'Operation could not be carried out because there is no color conversion hardware present or available.';
- DDERR_NOCOLORKEY: Result := 'Surface does not currently have a color key';
- DDERR_NOCOLORKEYHW: Result := 'Operation could not be carried out because there is no hardware support of the destination color key.';
- DDERR_NOCOOPERATIVELEVELSET: Result := 'Create function called without DirectDraw object method SetCooperativeLevel being called.';
- DDERR_NODC: Result := 'No DC was ever created for this surface.';
- DDERR_NODDROPSHW: Result := 'No DirectDraw ROP hardware.';
- DDERR_NODIRECTDRAWHW: Result := 'A hardware-only DirectDraw object creation was attempted but the driver did not support any hardware.';
- DDERR_NOEMULATION: Result := 'Software emulation not available.';
- DDERR_NOEXCLUSIVEMODE: Result := 'Operation requires the application to have exclusive mode but the application does not have exclusive mode.';
- DDERR_NOFLIPHW: Result := 'Flipping visible surfaces is not supported.';
- DDERR_NOGDI: Result := 'There is no GDI present.';
- DDERR_NOHWND: Result := 'Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel HWND.';
- DDERR_NOMIRRORHW: Result := 'Operation could not be carried out because there is no hardware present or available.';
- DDERR_NOOVERLAYDEST: Result := 'Returned when GetOverlayPosition is called on an overlay that UpdateOverlay has never been called on to establish a destination.';
- DDERR_NOOVERLAYHW: Result := 'Operation could not be carried out because there is no overlay hardware present or available.';
- DDERR_NOPALETTEATTACHED: Result := 'No palette object attached to this surface.';
- DDERR_NOPALETTEHW: Result := 'No hardware support for 16 or 256 color palettes.';
- DDERR_NORASTEROPHW: Result := 'Operation could not be carried out because there is no appropriate raster op hardware present or available.';
- DDERR_NOROTATIONHW: Result := 'Operation could not be carried out because there is no rotation hardware present or available.';
- DDERR_NOSTRETCHHW: Result := 'Operation could not be carried out because there is no hardware support for stretching.';
- DDERR_NOT4BITCOLOR: Result := 'DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color palette.';
- DDERR_NOT4BITCOLORINDEX: Result := 'DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color index palette.';
- DDERR_NOT8BITCOLOR: Result := 'DirectDrawSurface is not in 8 bit color mode and the requested operation requires 8 bit color.';
- DDERR_NOTAOVERLAYSURFACE: Result := 'Returned when an overlay member is called for a non-overlay surface.';
- DDERR_NOTEXTUREHW: Result := 'Operation could not be carried out because there is no texture mapping hardware present or available.';
- DDERR_NOTFLIPPABLE: Result := 'An attempt has been made to flip a surface that is not flippable.';
- DDERR_NOTFOUND: Result := 'Requested item was not found.';
- DDERR_NOTLOCKED: Result := 'Surface was not locked. An attempt to unlock a surface that was not locked at all, or by this process, has been attempted.';
- DDERR_NOTPALETTIZED: Result := 'The surface being used is not a palette-based surface.';
- DDERR_NOVSYNCHW: Result := 'Operation could not be carried out because there is no hardware support for vertical blank synchronized operations.';
- DDERR_NOZBUFFERHW: Result := 'Operation could not be carried out because there is no hardware support for zbuffer blitting.';
- DDERR_NOZOVERLAYHW: Result := 'Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support z layering of overlays.';
- DDERR_OUTOFCAPS: Result := 'The hardware needed for the requested operation has already been allocated.';
- DDERR_OUTOFMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
- DDERR_OUTOFVIDEOMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
- DDERR_OVERLAYCANTCLIP: Result := 'The hardware does not support clipped overlays.';
- DDERR_OVERLAYCOLORKEYONLYONEACTIVE: Result := 'Can only have ony color key active at one time for overlays.';
- DDERR_OVERLAYNOTVISIBLE: Result := 'Returned when GetOverlayPosition is called on a hidden overlay.';
- DDERR_PALETTEBUSY: Result := 'Access to this palette is being refused because the palette is already locked by another thread.';
- DDERR_PRIMARYSURFACEALREADYEXISTS: Result := 'This process already has created a primary surface.';
- DDERR_REGIONTOOSMALL: Result := 'Region passed to Clipper::GetClipList is too small.';
- DDERR_SURFACEALREADYATTACHED: Result := 'This surface is already attached to the surface it is being attached to.';
- DDERR_SURFACEALREADYDEPENDENT: Result := 'This surface is already a dependency of the surface it is being made a dependency of.';
- DDERR_SURFACEBUSY: Result := 'Access to this surface is being refused because the surface is already locked by another thread.';
- DDERR_SURFACEISOBSCURED: Result := 'Access to surface refused because the surface is obscured.';
- DDERR_SURFACELOST: Result := 'Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it.';
- DDERR_SURFACENOTATTACHED: Result := 'The requested surface is not attached.';
- DDERR_TOOBIGHEIGHT: Result := 'Height requested by DirectDraw is too large.';
- DDERR_TOOBIGSIZE: Result := 'Size requested by DirectDraw is too large, but the individual height and width are OK.';
- DDERR_TOOBIGWIDTH: Result := 'Width requested by DirectDraw is too large.';
- DDERR_UNSUPPORTED: Result := 'Action not supported.';
- DDERR_UNSUPPORTEDFORMAT: Result := 'FOURCC format requested is unsupported by DirectDraw.';
- DDERR_UNSUPPORTEDMASK: Result := 'Bitmask in the pixel format requested is unsupported by DirectDraw.';
- DDERR_VERTICALBLANKINPROGRESS: Result := 'Vertical blank is in progress.';
- DDERR_WASSTILLDRAWING: Result := 'Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is incomplete.';
- DDERR_WRONGMODE: Result := 'This surface can not be restored because it was created in a different mode.';
- DDERR_XALIGN: Result := 'Rectangle provided was not horizontally aligned on required boundary.';
- // new:
- DDERR_OVERLAPPINGRECTS: Result := 'Operation could not be carried out because the source and destination rectangles are on the same surface and overlap each other.';
- DDERR_INVALIDSTREAM: Result := 'The specified stream contains invalid data';
- DDERR_UNSUPPORTEDMODE: Result := 'The display is currently in an unsupported mode';
- DDERR_NOMIPMAPHW: Result := 'Operation could not be carried out because there is no mip-map texture mapping hardware present or available.';
- DDERR_INVALIDSURFACETYPE: Result := 'The requested action could not be performed because the surface was of the wrong type.';
- DDERR_NOOPTIMIZEHW: Result := 'Device does not support optimized surfaces, therefore no video memory optimized surfaces';
- DDERR_NOTLOADED: Result := 'Surface is an optimized surface, but has not yet been allocated any memory';
- DDERR_NOFOCUSWINDOW: Result := 'Attempt was made to create or set a device window without first setting the focus window';
- DDERR_DCALREADYCREATED: Result := 'A DC has already been returned for this surface. Only one DC can be retrieved per surface.';
- DDERR_NONONLOCALVIDMEM: Result := 'An attempt was made to allocate non-local video memory from a device that does not support non-local video memory.';
- DDERR_CANTPAGELOCK: Result := 'The attempt to page lock a surface failed.';
- DDERR_CANTPAGEUNLOCK: Result := 'The attempt to page unlock a surface failed.';
- DDERR_NOTPAGELOCKED: Result := 'An attempt was made to page unlock a surface with no outstanding page locks.';
- DDERR_MOREDATA: Result := 'There is more data available than the specified buffer size could hold';
- DDERR_EXPIRED: Result := 'The data has expired and is therefore no longer valid.';
- DDERR_VIDEONOTACTIVE: Result := 'The video port is not active';
- DDERR_DEVICEDOESNTOWNSURFACE: Result := 'Surfaces created by one direct draw device cannot be used directly by another direct draw device.';
- DDERR_NOTINITIALIZED: Result := 'An attempt was made to invoke an interface member of a DirectDraw object created by CoCreateInstance() before it was initialized.';
- else Result := 'Unrecognized Error';
- end;
- end;
- {$IFDEF DIRECTDRAW_DYNAMIC_LINK}
- var
- DirectDrawLib: THandle = 0;
- function DirectDrawLoaded: Boolean;
- begin
- Result:= DirectDrawLib <> 0;
- end;
- function UnLoadDirectDraw: Boolean;
- begin
- Result:= True;
- if DirectDrawLoaded then
- begin
- Result:= FreeLibrary(DirectDrawLib);
- DirectDrawEnumerateA := nil;
- DirectDrawEnumerateW := nil;
- DirectDrawEnumerate := nil;
- DirectDrawEnumerateExA := nil;
- DirectDrawEnumerateExW := nil;
- DirectDrawEnumerateEx := nil;
- DirectDrawCreate := nil;
- DirectDrawCreateEx := nil;
- DirectDrawCreateClipper := nil;
- {$IFDEF WINNT}
- NtDirectDrawCreate := nil;
- {$ENDIF}
- DirectDrawLib:= 0;
- end;
- end;
- function LoadDirectDraw: Boolean;
- begin
- Result:= DirectDrawLoaded;
- if (not Result) then
- begin
- DirectDrawLib:= LoadLibrary(DirectDrawDll);
- if DirectDrawLoaded then
- begin
- DirectDrawEnumerateA := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateA');
- DirectDrawEnumerateW := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateW');
- {$IFDEF UNICODE}
- DirectDrawEnumerate := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateW');
- {$ELSE}
- DirectDrawEnumerate := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateA');
- {$ENDIF}
- DirectDrawEnumerateExA := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExA');
- DirectDrawEnumerateExW := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExW');
- {$IFDEF UNICODE}
- DirectDrawEnumerateEx := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExW');
- {$ELSE}
- DirectDrawEnumerateEx := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExA');
- {$ENDIF}
- DirectDrawCreate := GetProcAddress(DDrawDLL,'DirectDrawCreate');
- DirectDrawCreateEx := GetProcAddress(DDrawDLL,'DirectDrawCreateEx');
- DirectDrawCreateClipper := GetProcAddress(DDrawDLL,'DirectDrawCreateClipper');
- {$IFDEF WINNT}
- NtDirectDrawCreate := GetProcAddress(DDrawDLL,'NtDirectDrawCreate');
- {$ENDIF}
- Result:= Assigned(DirectDrawCreate); // At least basic procedure is found!
- if not Result then UnLoadDirectDraw;
- end;
- end;
- end;
- {$ELSE}
- function DirectDrawLoaded: Boolean;
- begin // Stub function for static linking
- Result:= True;
- end;
- function UnLoadDirectDraw: Boolean;
- begin // Stub function for static linking
- Result:= True; // should emulate "normal" behaviour
- end;
- function LoadDirectDraw: Boolean;
- begin // Stub function for static linking
- Result:= True;
- end;
- {$ENDIF}
- {$IFDEF DIRECTDRAW_DYNAMIC_LINK}
- initialization
- {$IFNDEF DIRECTDRAW_DYNAMIC_LINK_EXPLICIT}
- LoadDirectDraw;
- {$ENDIF}
- finalization
- UnLoadDirectDraw;
- {$ENDIF}
- end.