#ifndef TDDBltFXH #define TDDBltFXH // ========================================================================== // // File: TDDBltFX.H // Created: 12th February 2009 // Author: BCB_Code_Generator v2.10, // Darren John Dwyer // ( // data entry, // source code, // documentation, // help files, // project files, // tutorials, // demos, // website // ) // // Hugh Dunbar Edwards // ( // data entry creation, // documentation creation, // icon creation // ) // // Description: This file defines the TDDBltFX Component // // "TDx_Library v1.90" // "TDx_Draw_Library v1.90" // // (c) 2009 Darren John Dwyer, Australia. // All Rights Reserved. // // Refer to the 'License.Txt' file for licencing & copyright information. // // ========================================================================== // -------------------------------------------------------------------------- #include "TDx_Library_Defns.H" #include "TDx_Library_Functions.H" // -------------------------------------------------------------------------- #include "TDx_Draw_Library_Defns.H" #include "TDx_Draw_Library_Functions.H" // -------------------------------------------------------------------------- // external classes used by TDDBltFX properties. #include "TDx_DrawSurface.H" #include "TDDColorKey.H" // ========================================================================== // Set: TDDBltFXFX_Set // Description: A set of mangled DirectX flag names that are used to set the // TDDBltFX::FX property using the BCB Object Inspector. For // detailed descriptions of each flag, see the FX property // description below. // ========================================================================== enum TDDBltFX_FX_Flags { ddbltfx_arithstretchy, ddbltfx_mirrorleftright, ddbltfx_mirrorupdown, ddbltfx_notearing, ddbltfx_rotate180, ddbltfx_rotate270, ddbltfx_rotate90, ddbltfx_zbufferbasedest, ddbltfx_zbufferrange }; typedef Set< TDDBltFX_FX_Flags, ddbltfx_arithstretchy, ddbltfx_zbufferrange > TDDBltFX_FX_Set; // -------------------------------------------------------------------------- // ========================================================================== // Class: TDDBltFX // Class Type: Wrapper // Description: The TDDBltFX component wraps the DirectX DDBLTFX structure, // which describes modifications to the execution of blit // operations. // // It is used by the TDx_DrawSurface::Blt() method to specify // raster operations, effects and to override existing blit // information when the corresponding flags of that method are // set. // // Z-buffering or alpha blending on blits is not currently // supported. // ========================================================================== #if (__BORLANDC__ >= 0x0530) // BCB Version 3 + class PACKAGE TDDBltFX : public TComponent { // -------------------------------------------------------------------------- #else // BCB Version 1 class TDDBltFX : public TComponent { #endif // ========================================================================== __published: // ========================================================================== // ---------------------------------------------------------------------- // Property: FX_ // Description: The FX property defines flags that control or modify the // type of FX operations performed when blitting. // The described effect applies when the flag is set. // Note: This property is used to set the various DirectX Flags // for the 'FX' property via the BCB Object Inspector. For // detailed descriptions of each flag, see the FX property // description below. // ---------------------------------------------------------------------- __property TDDBltFX_FX_Set FX_ = { read=FGetFX_, write=FSetFX_, nodefault }; // ---------------------------------------------------------------------- // Property: AlphaDest // Description: The AlphaDest property references the surface used as the // destination alpha channel when // DDBLT_ALPHADESTSURFACEOVERRIDE is set in the Flags // parameter of TDx_DrawSurface::Blt(). // The DDBLT_ALPHADESTSURFACEOVERRIDE flag is not currently // supported. // ---------------------------------------------------------------------- __property TDx_DrawSurface* AlphaDest = { read=FGetAlphaDest, write=FSetAlphaDest, default=NULL }; // ---------------------------------------------------------------------- // Property: AlphaDestConst // Description: The AlphaDestConst property defines the constant alpha // value used as the destination alpha channel when // DDBLT_ALPHADESTCONSTOVERRIDE is set in the Flags // parameter of TDx_DrawSurface::Blt(). // The DDBLT_ALPHADESTCONSTOVERRIDE flag is not currently // supported. // ---------------------------------------------------------------------- __property dword AlphaDestConst = { read=FGetAlphaDestConst, write=FSetAlphaDestConst, default=0 }; // ---------------------------------------------------------------------- // Property: AlphaDestConstBitDepth // Description: The AlphaDestConstBitDepth property defines the bit depth // of the alpha constant contained in // TDDBltFX::AlphaDestConst. // ---------------------------------------------------------------------- __property dword AlphaDestConstBitDepth = { read=FGetAlphaDestConstBitDepth, write=FSetAlphaDestConstBitDepth, default=0 }; // ---------------------------------------------------------------------- // Property: AlphaEdgeBlend // Description: The AlphaEdgeBlend property defines the alpha constant // used for alpha edge blending when DDBLT_ALPHAEDGEBLEND is // set in the Flags parameter of TDx_DrawSurface::Blt(). // The DDBLT_ALPHAEDGEBLEND flag is not currently supported. // ---------------------------------------------------------------------- __property dword AlphaEdgeBlend = { read=FGetAlphaEdgeBlend, write=FSetAlphaEdgeBlend, default=0 }; // ---------------------------------------------------------------------- // Property: AlphaEdgeBlendBitDepth // Description: The AlphaEdgeBlendBitDepth property defines the bit depth // of the alpha constant contained in // TDDBltFX::AlphaEdgeBlend. // ---------------------------------------------------------------------- __property dword AlphaEdgeBlendBitDepth = { read=FGetAlphaEdgeBlendBitDepth, write=FSetAlphaEdgeBlendBitDepth, default=0 }; // ---------------------------------------------------------------------- // Property: AlphaSrc // Description: The AlphaSrc property references the surface used as the // source alpha channel when DDBLT_ALPHASRCSURFACEOVERRIDE // is set in the Flags parameter of TDx_DrawSurface::Blt(). // The DDBLT_ALPHASRCSURFACEOVERRIDE flag is not currently // supported. // ---------------------------------------------------------------------- __property TDx_DrawSurface* AlphaSrc = { read=FGetAlphaSrc, write=FSetAlphaSrc, default=NULL }; // ---------------------------------------------------------------------- // Property: AlphaSrcConst // Description: The AlphaSrcConst property defines a constant alpha value // used as the source alpha channel when // DDBLT_ALPHASRCCONSTOVERRIDE is set in the Flags parameter // of TDx_DrawSurface::Blt(). // The DDBLT_ALPHASRCCONSTOVERRIDE flag is not currently // supported. // ---------------------------------------------------------------------- __property dword AlphaSrcConst = { read=FGetAlphaSrcConst, write=FSetAlphaSrcConst, default=0 }; // ---------------------------------------------------------------------- // Property: AlphaSrcConstBitDepth // Description: The AlphaSrcConstBitDepth property defines the bit depth // of the alpha constant contained in // TDDBltFX::AlphaSrcConst. // ---------------------------------------------------------------------- __property dword AlphaSrcConstBitDepth = { read=FGetAlphaSrcConstBitDepth, write=FSetAlphaSrcConstBitDepth, default=0 }; // ---------------------------------------------------------------------- // Property: DDRop // Description: The DDRop property defines a non standard raster // operation code. // TDx_Draw::GetCaps() can be used to retrieve the available // raster operations. // ---------------------------------------------------------------------- __property dword DDRop = { read=FGetDDRop, write=FSetDDRop, default=0 }; // ---------------------------------------------------------------------- // Property: DestColorkey // Description: The DestColorkey property references the color key used // as the destination color key when DDBLT_KEYDESTOVERRIDE // is set in the Flags parameter of TDx_DrawSurface::Blt(). // ---------------------------------------------------------------------- __property TDDColorKey* DestColorkey = { read=FGetDestColorkey, write=FSetDestColorkey, default=NULL }; // ---------------------------------------------------------------------- // Property: FillColor // Description: The FillColor property defines the color value used for // filling a surface when DDBLT_COLORFILL is set in the // Flags parameter of TDx_DrawSurface::Blt(). // This value may be a palette index or a pixel value of the // appropriate bit depth depending on the pixel format of // the destination surface. // ---------------------------------------------------------------------- __property dword FillColor = { read=FGetFillColor, write=FSetFillColor, default=0 }; // ---------------------------------------------------------------------- // Property: FillDepth // Description: The FillDepth property defines the z-order value // specifying the depth at which a color fill takes place on // a z-buffered blit. // ---------------------------------------------------------------------- __property dword FillDepth = { read=FGetFillDepth, write=FSetFillDepth, default=0 }; // ---------------------------------------------------------------------- // Property: FillPixel // Description: The FillPixel property defines the pixel value used for // RGBA or RGBZ fills when DDBLT_COLORFILL is set in the // Flags parameter of TDx_DrawSurface::Blt(). // When using RGBZ fills this property should be used rather // than TDDBltFX::FillColor or TDDBltFX::FillDepth. // ---------------------------------------------------------------------- __property dword FillPixel = { read=FGetFillPixel, write=FSetFillPixel, default=0 }; // ---------------------------------------------------------------------- // Property: Pattern // Description: The Pattern property references a surface to be used as a // blit pattern. // ---------------------------------------------------------------------- __property TDx_DrawSurface* Pattern = { read=FGetPattern, write=FSetPattern, default=NULL }; // ---------------------------------------------------------------------- // Property: Rop // Description: The Rop property defines a standard windows raster // operation code. // The standard raster operations are listed in the Win32 // API help files. // TDx_Draw::GetCaps() can be used to retrieve the available // raster operations. // ---------------------------------------------------------------------- __property dword Rop = { read=FGetRop, write=FSetRop, default=0 }; // ---------------------------------------------------------------------- // Property: RotationAngle // Description: The RotationAngle property defines the rotation angle, in // 100th's of a degree, to be applied before blitting when // DDBLT_ROTATIONANGLE is set in the Flags parameter of // TDx_DrawSurface::Blt(). // ---------------------------------------------------------------------- __property dword RotationAngle = { read=FGetRotationAngle, write=FSetRotationAngle, default=0 }; // ---------------------------------------------------------------------- // Property: Size // Description: The Size property defines the size, in bytes, of the // internal structure used by this component. // ---------------------------------------------------------------------- __property dword Size = { read=FGetSize, write=FSetSize, default=sizeof(DDBLTFX) }; // ---------------------------------------------------------------------- // Property: SrcColorkey // Description: The SrcColorkey property references a color key used as // the source color key when DDBLT_KEYSRCOVERRIDE is set in // the Flag parameter of TDx_DrawSurface::Blt(). // ---------------------------------------------------------------------- __property TDDColorKey* SrcColorkey = { read=FGetSrcColorkey, write=FSetSrcColorkey, default=NULL }; // ---------------------------------------------------------------------- // Property: ZBufferBaseDest // Description: The ZBufferBaseDest property defines a value to be added // to each source z-value before comparison with the // destination z-values when the // TDDBltFX::FX->DDBLTFX_ZBUFFERBASEDEST flag is set. // ---------------------------------------------------------------------- __property dword ZBufferBaseDest = { read=FGetZBufferBaseDest, write=FSetZBufferBaseDest, default=0 }; // ---------------------------------------------------------------------- // Property: ZBufferDest // Description: The ZBufferDest property references a surface that will // substitute for the destination z-buffer when // DDBLT_ZBUFFERDESTOVERRIDE is set in the Flags parameter // of TDx_DrawSurface::Blt(). // The DDBLT_ZBUFFERDESTOVERRIDE flag is not currently // supported. // ---------------------------------------------------------------------- __property TDx_DrawSurface* ZBufferDest = { read=FGetZBufferDest, write=FSetZBufferDest, default=NULL }; // ---------------------------------------------------------------------- // Property: ZBufferHigh // Description: The ZBufferHigh property defines the highest z-value // within the source rectangle that may be copied to the // destination surface when the // TDDBltFX::FX->DDBLTFX_ZBUFFERRANGE flag is set. // ---------------------------------------------------------------------- __property dword ZBufferHigh = { read=FGetZBufferHigh, write=FSetZBufferHigh, default=0 }; // ---------------------------------------------------------------------- // Property: ZBufferLow // Description: The ZBufferLow property defines the lowest z-value within // the source rectangle that may be copied to the // destination surface when the // TDDBltFX::FX->DDBLTFX_ZBUFFERRANGE flag is set. // ---------------------------------------------------------------------- __property dword ZBufferLow = { read=FGetZBufferLow, write=FSetZBufferLow, default=0 }; // ---------------------------------------------------------------------- // Property: ZBufferOpCode // Description: The ZBufferOpCode property defines the operation code // used when comparing source and destination z-buffers to // determine whether or not pixels should be blitted to the // destination surface. // ---------------------------------------------------------------------- __property dword ZBufferOpCode = { read=FGetZBufferOpCode, write=FSetZBufferOpCode, default=0 }; // ---------------------------------------------------------------------- // Property: ZBufferSrc // Description: The ZBufferSrc property references the surface that will // substitute for the source z-buffer when // DDBLT_ZBUFFERSRCOVERRIDE is set in the Flags parameter of // TDx_DrawSurface::Blt(). // The DDBLT_ZBUFFERSRCOVERRIDE flag is not currently // supported. // ---------------------------------------------------------------------- __property TDx_DrawSurface* ZBufferSrc = { read=FGetZBufferSrc, write=FSetZBufferSrc, default=NULL }; // ---------------------------------------------------------------------- // Property: ZDestConst // Description: The ZDestConst property defines a constant z-value which // will substitute for the destination z-buffer when // DDBLT_ZBUFFERDESTCONSTOVERRIDE is set in the Flags // parameter of TDx_DrawSurface::Blt(). // The DDBLT_ZBUFFERDESTCONSTOVERRIDE flag is not currently // supported. // ---------------------------------------------------------------------- __property dword ZDestConst = { read=FGetZDestConst, write=FSetZDestConst, default=0 }; // ---------------------------------------------------------------------- // Property: ZDestConstBitDepth // Description: The ZDestConstBitDepth property defines the bit depth of // the z-value constant contained in TDDBltFX::ZDestConst. // ---------------------------------------------------------------------- __property dword ZDestConstBitDepth = { read=FGetZDestConstBitDepth, write=FSetZDestConstBitDepth, default=0 }; // ---------------------------------------------------------------------- // Property: ZSrcConst // Description: The ZSrcConst property defines a constant z-value used to // substitute for the source z-buffer when // DDBLT_ZBUFFERSRCCONSTOVERRIDE is set in the Flags // parameter of TDx_DrawSurface::Blt(). // The DDBLT_ZBUFFERSRCCONSTOVERRIDE flag is not currently // supported. // ---------------------------------------------------------------------- __property dword ZSrcConst = { read=FGetZSrcConst, write=FSetZSrcConst, default=0 }; // ---------------------------------------------------------------------- // Property: ZSrcConstBitDepth // Description: The ZSrcConstBitDepth property defines the bit depth of // the z-value constant contained in TDDBltFX::ZSrcConst. // ---------------------------------------------------------------------- __property dword ZSrcConstBitDepth = { read=FGetZSrcConstBitDepth, write=FSetZSrcConstBitDepth, default=0 }; // ---------------------------------------------------------------------- // Event: OnError() // Description: The OnError event is called when an error occurs in the // TDDBltFX component. // ---------------------------------------------------------------------- __property TDx_Error OnError = {read=FOnError, write=FOnError, nodefault}; // ========================================================================== public: // ========================================================================== // ---------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TDDBltFX method or fget/fset. // eg. DD_OK or DDERR_SURFACELOST or TDX_ERROR // ---------------------------------------------------------------------- __property HRESULT ErrorValue = { read=FGetErrorValue, write=FSetErrorValue, default=DD_OK }; // ---------------------------------------------------------------------- // Property: FX // Description: The FX property defines flags that control or modify the // type of FX operations performed when blitting. // The described effect applies when the flag is set. // Flags: DDBLTFX_ARITHSTRETCHY - // Blitting is to be performed with a different Y // dimension by using arithmetic stretching. // DDBLTFX_MIRRORLEFTRIGHT - // Perform blitting while mirroring from left to right by // turning the surface on its Y axis. // DDBLTFX_MIRRORUPDOWN - // Perform blitting while mirroring from top to bottom by // turning the surface on its X axis. // DDBLTFX_NOTEARING - // Schedule blitting to synchronise with the vertical // blank. // Blits are performed asynchronously by default. // Synchronous blitting can help avoid artifacts such as // tearing. // DDBLTFX_ROTATE180 - // Perform blitting while rotating the image 180 degrees // clockwise. // This will result in the blitted image being displayed // upside down. // DDBLTFX_ROTATE270 - // Perform blitting while rotating 270 degrees clockwise. // This will result in the blitted image being turned onto // its left hand side. // DDBLTFX_ROTATE90 - // Perform blitting while rotating 90 degrees clockwise. // This will result in the blitted image being turned onto // its right hand side. // DDBLTFX_ZBUFFERBASEDEST - // Perform z-buffer blitting by adding // TDDBltFX::ZBufferBaseDest to each of the source // z-values before comparison with the destination // z-values. // DDBLTFX_ZBUFFERRANGE - // Perform z-buffer blitting, using only those pixels of // the source surface that have z-orders between the // values of TDDBltFX::ZBufferLow and // TDDBltFX::ZBufferHigh. // ---------------------------------------------------------------------- __property dword FX = { read=FGetFX, write=FSetFX, default=0 }; // ---------------------------------------------------------------------- // Method: Clear() // Description: The Clear() method can be used to clear the contents of // the TDDBltFX's internal DDBLTFX structure. // Note: if you have manually linked a structure member to a // chunk of memory, make sure you release this memory before // calling Clear(). // ---------------------------------------------------------------------- virtual void __fastcall Clear(); // ---------------------------------------------------------------------- // Property: FX_Strings() // Description: This property returns a TStringList containing current // flag values for the FX property. Note: Any memory // associated with these strings is released on destruction. // ---------------------------------------------------------------------- __property TStringList* FX_Strings = { read=FGetFX_Strings }; // ---------------------------------------------------------------------- // Constructor() and Destructor() // ---------------------------------------------------------------------- __fastcall TDDBltFX(TComponent* Owner); virtual __fastcall ~TDDBltFX(); // ---------------------------------------------------------------------- // Internal Structure Access // ---------------------------------------------------------------------- __property DDBLTFX* Internal_DDBLTFX_Ptr = { read=FGetInternal_DDBLTFX_Ptr, nodefault }; void __fastcall Internal_DDBLTFX_Update(); // ========================================================================== protected: // ========================================================================== // ---------------------------------------------------------------------- // Object Inspector 'Flag' Access Methods // ---------------------------------------------------------------------- TDDBltFX_FX_Set __fastcall FGetFX_(); void __fastcall FSetFX_( TDDBltFX_FX_Set pFX_ ); // ---------------------------------------------------------------------- // Property Access Methods // ---------------------------------------------------------------------- TDx_DrawSurface* __fastcall FGetAlphaDest(); void __fastcall FSetAlphaDest( TDx_DrawSurface* pAlphaDest ); dword __fastcall FGetAlphaDestConst(); void __fastcall FSetAlphaDestConst( dword pAlphaDestConst ); dword __fastcall FGetAlphaDestConstBitDepth(); void __fastcall FSetAlphaDestConstBitDepth( dword pAlphaDestConstBitDepth ); dword __fastcall FGetAlphaEdgeBlend(); void __fastcall FSetAlphaEdgeBlend( dword pAlphaEdgeBlend ); dword __fastcall FGetAlphaEdgeBlendBitDepth(); void __fastcall FSetAlphaEdgeBlendBitDepth( dword pAlphaEdgeBlendBitDepth ); TDx_DrawSurface* __fastcall FGetAlphaSrc(); void __fastcall FSetAlphaSrc( TDx_DrawSurface* pAlphaSrc ); dword __fastcall FGetAlphaSrcConst(); void __fastcall FSetAlphaSrcConst( dword pAlphaSrcConst ); dword __fastcall FGetAlphaSrcConstBitDepth(); void __fastcall FSetAlphaSrcConstBitDepth( dword pAlphaSrcConstBitDepth ); dword __fastcall FGetDDRop(); void __fastcall FSetDDRop( dword pDDRop ); TDDColorKey* __fastcall FGetDestColorkey(); void __fastcall FSetDestColorkey( TDDColorKey* pDestColorkey ); HRESULT __fastcall FGetErrorValue(); void __fastcall FSetErrorValue( HRESULT pErrorValue ); dword __fastcall FGetFX(); void __fastcall FSetFX( dword pFX ); dword __fastcall FGetFillColor(); void __fastcall FSetFillColor( dword pFillColor ); dword __fastcall FGetFillDepth(); void __fastcall FSetFillDepth( dword pFillDepth ); dword __fastcall FGetFillPixel(); void __fastcall FSetFillPixel( dword pFillPixel ); TDx_DrawSurface* __fastcall FGetPattern(); void __fastcall FSetPattern( TDx_DrawSurface* pPattern ); dword __fastcall FGetRop(); void __fastcall FSetRop( dword pRop ); dword __fastcall FGetRotationAngle(); void __fastcall FSetRotationAngle( dword pRotationAngle ); dword __fastcall FGetSize(); void __fastcall FSetSize( dword pSize ); TDDColorKey* __fastcall FGetSrcColorkey(); void __fastcall FSetSrcColorkey( TDDColorKey* pSrcColorkey ); dword __fastcall FGetZBufferBaseDest(); void __fastcall FSetZBufferBaseDest( dword pZBufferBaseDest ); TDx_DrawSurface* __fastcall FGetZBufferDest(); void __fastcall FSetZBufferDest( TDx_DrawSurface* pZBufferDest ); dword __fastcall FGetZBufferHigh(); void __fastcall FSetZBufferHigh( dword pZBufferHigh ); dword __fastcall FGetZBufferLow(); void __fastcall FSetZBufferLow( dword pZBufferLow ); dword __fastcall FGetZBufferOpCode(); void __fastcall FSetZBufferOpCode( dword pZBufferOpCode ); TDx_DrawSurface* __fastcall FGetZBufferSrc(); void __fastcall FSetZBufferSrc( TDx_DrawSurface* pZBufferSrc ); dword __fastcall FGetZDestConst(); void __fastcall FSetZDestConst( dword pZDestConst ); dword __fastcall FGetZDestConstBitDepth(); void __fastcall FSetZDestConstBitDepth( dword pZDestConstBitDepth ); dword __fastcall FGetZSrcConst(); void __fastcall FSetZSrcConst( dword pZSrcConst ); dword __fastcall FGetZSrcConstBitDepth(); void __fastcall FSetZSrcConstBitDepth( dword pZSrcConstBitDepth ); // ---------------------------------------------------------------------- // Flag_Strings Access Methods // ---------------------------------------------------------------------- TStringList* __fastcall FGetFX_Strings(); // ========================================================================== private: // ========================================================================== // ---------------------------------------------------------------------- // Internal Structure Access // ---------------------------------------------------------------------- DDBLTFX* __fastcall FGetInternal_DDBLTFX_Ptr(); void __fastcall FSetInternal_DDBLTFX( DDBLTFX* pDDBLTFX ); // ---------------------------------------------------------------------- // Property Variables // ---------------------------------------------------------------------- TDx_DrawSurface* fAlphaDest; TDx_DrawSurface* fAlphaSrc; TDDColorKey* fDestColorkey; HRESULT fErrorValue; TDx_DrawSurface* fPattern; TDDColorKey* fSrcColorkey; TDx_DrawSurface* fZBufferDest; TDx_DrawSurface* fZBufferSrc; // ---------------------------------------------------------------------- // Flags_Strings Variables // ---------------------------------------------------------------------- TStringList* fFX_Strings; // ---------------------------------------------------------------------- // Structure Variables // ---------------------------------------------------------------------- DDBLTFX fDDBLTFX; // ---------------------------------------------------------------------- // Event Variables // ---------------------------------------------------------------------- TDx_Error FOnError; }; // -------------------------------------------------------------------------- #endif // --------------------------------------------------------------------------