// -------------------------------------------------------------------------- // ========================================================================== // File: TD3DPrimCaps.CPP // Authors: BCB_Code_Generator v1.70, // Darren Dwyer (source code, documentation, demos, website), // Hugh Edwards (documentation, icons), // Brian Austin (documentation) // Description: This file contains the code for the TD3DPrimCaps Component // // "TDx_3DI_Library v1.70" // (c) 2003 BCB-Tools.com Pty. Ltd., Sydney, Australia. // All Rights Reserved. // // Refer to the 'Licence.Txt' file for licencing & copyright information. // ========================================================================== // -------------------------------------------------------------------------- // #includes ... // -------------------------------------------------------------------------- #include #pragma hdrstop // -------------------------------------------------------------------------- #include "TD3DPrimCaps.H" // -------------------------------------------------------------------------- #pragma link "TDx_Library_Defns" #pragma link "TDx_Library_Functions" #pragma link "TDx_3DI_Library_Defns" #pragma link "TDx_3DI_Library_Functions" // -------------------------------------------------------------------------- // Object Registration... // -------------------------------------------------------------------------- #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ #pragma package(smart_init) #endif // -------------------------------------------------------------------------- static inline void ValidCtrCheck(TD3DPrimCaps*) { new TD3DPrimCaps(NULL); } // -------------------------------------------------------------------------- namespace Td3dprimcaps { #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ void __fastcall PACKAGE Register() #else void __fastcall Register() #endif { TComponentClass classes[1] = {__classid(TD3DPrimCaps)}; RegisterComponents("TDx_3DI", classes, 0); } } // -------------------------------------------------------------------------- // Constructor: TD3DPrimCaps::TD3DPrimCaps() // Description: The default constructor for the TD3DPrimCaps object. // -------------------------------------------------------------------------- __fastcall TD3DPrimCaps::TD3DPrimCaps(TComponent* Owner) : TComponent(Owner) { Clear(); fAlphaCmpCaps_Strings=NULL; fDestBlendCaps_Strings=NULL; fMiscCaps_Strings=NULL; fRasterCaps_Strings=NULL; fShadeCaps_Strings=NULL; fSrcBlendCaps_Strings=NULL; fTextureAddressCaps_Strings=NULL; fTextureCaps_Strings=NULL; fTextureFilterCaps_Strings=NULL; fZCmpCaps_Strings=NULL; } // -------------------------------------------------------------------------- // Destructor: TD3DPrimCaps::~TD3DPrimCaps() // Description: The destructor for the TD3DPrimCaps object. // -------------------------------------------------------------------------- __fastcall TD3DPrimCaps::~TD3DPrimCaps() { if (fAlphaCmpCaps_Strings!=NULL) delete fAlphaCmpCaps_Strings; if (fDestBlendCaps_Strings!=NULL) delete fDestBlendCaps_Strings; if (fMiscCaps_Strings!=NULL) delete fMiscCaps_Strings; if (fRasterCaps_Strings!=NULL) delete fRasterCaps_Strings; if (fShadeCaps_Strings!=NULL) delete fShadeCaps_Strings; if (fSrcBlendCaps_Strings!=NULL) delete fSrcBlendCaps_Strings; if (fTextureAddressCaps_Strings!=NULL) delete fTextureAddressCaps_Strings; if (fTextureCaps_Strings!=NULL) delete fTextureCaps_Strings; if (fTextureFilterCaps_Strings!=NULL) delete fTextureFilterCaps_Strings; if (fZCmpCaps_Strings!=NULL) delete fZCmpCaps_Strings; } // -------------------------------------------------------------------------- // Property: AlphaCmpCaps // Description: The AlphaCmpCaps property indicates which alpha test // comparisons are available. // The described effect applies when the flag is set. // // Alpha tests are not supported if only 0, D3DPCMPCAPS_ALWAYS // or D3DPCMPCAPS_NEVER are set. // Flags: D3DPCMPCAPS_ALWAYS - // Alpha testing is unavailable and all alpha tests will be // passed. // D3DPCMPCAPS_EQUAL - // Equality alpha testing is available, the test being passed // if the new alpha value is equal to the current alpha value. // D3DPCMPCAPS_GREATER - // Greater than alpha testing is available, the test being // passed if the new alpha value is greater than the current // alpha value. // D3DPCMPCAPS_GREATEREQUAL - // Greater than or equal to alpha testing is available, the // test being passed if the new alpha value is greater than or // equal to the current alpha value. // D3DPCMPCAPS_LESS - // Less than alpha testing is available, the test being passed // if the new alpha value is less than the current alpha // value. // D3DPCMPCAPS_LESSEQUAL - // Less than or equal to alpha testing is available, the test // being passed if the new alpha value is less than or equal // to the current alpha value. // D3DPCMPCAPS_NEVER - // Alpha testing is unavailable and all alpha tests will be // failed. // D3DPCMPCAPS_NOTEQUAL - // Not equal alpha testing is available, the test being passed // if the new alpha value is not equal to the current alpha // value. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetAlphaCmpCaps() { return fD3DPRIMCAPS.dwAlphaCmpCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetAlphaCmpCaps( dword pAlphaCmpCaps ) { fD3DPRIMCAPS.dwAlphaCmpCaps = pAlphaCmpCaps; } // -------------------------------------------------------------------------- // Property: DestBlendCaps // Description: The DestBlendCaps property indicate the destination blending // capablilties that are available. // The described effect applies when the flag is set. // // Each component of the RGBA value is denoted by the // corresponding capitalised letter, source and destination // being indicated by s and d respectively. // Flags: D3DPBLENDCAPS_BOTHINVSRCALPHA - // Support for using the inverted source alpha value as the // source blend factor and the source alpha value as the // destination blend factor of is available. // Source blend factor: (1-As, 1-As, 1-As, 1-As) // Destination blend factor: (As, As, As, As) // The destination blend selection is overridden. // D3DPBLENDCAPS_DESTALPHA - // Support for using the destination alpha value as the blend // factor is available. // Blend factor: (Ad, Ad, Ad, Ad) // D3DPBLENDCAPS_DESTCOLOR - // Support for using the destination color as the blend factor // is available. // Blend factor: (Rd, Gd, Bd, Ad) // D3DPBLENDCAPS_INVDESTALPHA - // Support for using the inverted destination alpha value as // the blend factor is available. // Blend factor: (1-Ad, 1-Ad, 1-Ad, 1-Ad) // D3DPBLENDCAPS_INVDESTCOLOR - // Support for using the inverted destination color as the // blend factor is available. // Blend factor: (1-Rd, 1-Gd, 1-Bd, 1-Ad) // D3DPBLENDCAPS_INVSRCALPHA - // Support for using the inverted source alpha value as the // blend factor is available. // Blend factor: (1-As, 1-As, 1-As, 1-As) // D3DPBLENDCAPS_INVSRCCOLOR - // Support for using the inverted source color as the blend // factor is available. // Blend factor: (1-Rs, 1-Gs, 1-Bs, 1-As) // D3DPBLENDCAPS_ONE - // Support for a blend factor of 1 is available. // Blend factor: (1, 1, 1, 1) // D3DPBLENDCAPS_SRCALPHA - // Support for using the source alpha value as the blend // factor is available. // Blend factor: (As, As, As, As) // D3DPBLENDCAPS_SRCALPHASAT - // Support for using the lower of the source alpha value or // inverted destination alpha value as the blend factor is // available. // Blend factor: (min(As, 1-Ad), min(As, 1-Ad), min(As, 1-Ad), // 1) // D3DPBLENDCAPS_SRCCOLOR - // Support for using the source color as the blend factor is // available. // Blend factor: (Rs, Gs, Bs, As) // D3DPBLENDCAPS_ZERO - // Support for a blend factor of 0 is available. // Blend factor: (0, 0, 0, 0) // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetDestBlendCaps() { return fD3DPRIMCAPS.dwDestBlendCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetDestBlendCaps( dword pDestBlendCaps ) { fD3DPRIMCAPS.dwDestBlendCaps = pDestBlendCaps; } // -------------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TD3DPrimCaps method or fget/fset. // eg. D3D_OK or DDERR_SURFACELOST or TDX_ERROR // -------------------------------------------------------------------------- HRESULT __fastcall TD3DPrimCaps::FGetErrorValue() { return fErrorValue; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetErrorValue( HRESULT pErrorValue ) { fErrorValue = pErrorValue; } // -------------------------------------------------------------------------- // Property: MiscCaps // Description: These flags indicate the general capabilities of the // primitive. // The described effect applies when the flag is set. // Flags: D3DPMISCCAPS_CONFORMANT - // The device is OpenGL compliant. // D3DPMISCCAPS_CULLCCW - // Support for counterclockwise culling of triangle primitives // is available. // // Software rendering uses a fixed culling order and thus // cannot change the culling mode. // D3DPMISCCAPS_CULLCW - // Support for clockwise culling of triangle primitives is // available. // // Software renderering uses a fixed culling order and thus // cannot change the culling mode. // D3DPMISCCAPS_CULLNONE - // Support for culling is not available. // D3DPMISCCAPS_LINEPATTERNREP - // Support for higher values than one in // TD3DLinePattern->RepeatFactor is available. // // This flag only applies only to line drawing primitives. // D3DPMISCCAPS_MASKPLANES - // Support for color plane bitmasks is available. // D3DPMISCCAPS_MASKZ - // Support for enabling and disabling z-buffer modification on // pixel operations is available. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetMiscCaps() { return fD3DPRIMCAPS.dwMiscCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetMiscCaps( dword pMiscCaps ) { fD3DPRIMCAPS.dwMiscCaps = pMiscCaps; } // -------------------------------------------------------------------------- // Property: RasterCaps // Description: These flags provide information on the raster drawing // capabilities of the device. // The described effect applies when the flag is set. // Flags: D3DPRASTERCAPS_ANISOTROPY - // Support for anisotropic filtering is available. // D3DPRASTERCAPS_ANTIALIASEDGES - // Support for antialias on lines forming the convex outline // of an object is available. // D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT - // Support for antialiasing is dependant on the sort order of // the polygons. // // The application must draw polygons in the right order for // antialiasing to occur (back to front or front to back). // // D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT - // Support for antialiasing is independant of the sort order // of the polygons. // D3DPRASTERCAPS_DITHER - // Support for dithering to improve color resolution is // available. // D3DPRASTERCAPS_FOGRANGE - // Support for range based fog is available. // Range based fog is computed using distance from viewer, // rather than relying on the z-buffer. // D3DPRASTERCAPS_FOGTABLE - // Support for fog values that are calculated by referring to // a lookup table of fog values indexed to the z-buffer is // available. // D3DPRASTERCAPS_FOGVERTEX - // The fog value is calculated by the device during the // lighting operation. // This calculated value is stored in the alpha component of // the TD3DColor in TD3DTLVertex::Specular. // The fog value is then interpolated during raturization. // D3DPRASTERCAPS_MIPMAPLODBIAS - // Support for level of detail (LOD) mipmap bias adjustments // is available. // This amounts to a sharpness setting for mipmaps. // D3DPRASTERCAPS_PAT - // Support for patterned drawing using // D3DRENDERSTATE_LINEPATTERN for lines or one of the // D3DRENDERSTATE_STIPPLEPATTERN render states for fills is // available. // D3DPRASTERCAPS_ROP2 - // Support for raster operations other than R2_COPYPEN is // available. // D3DPRASTERCAPS_STIPPLE - // Support for the stippling of polygons to simulate // translucency is available. // // D3DPRASTERCAPS_SUBPIXEL - // Support for the subpixel placement of z, color, and texture // data, rather than approximating to the nearest integer // pixel coordinate, is available. // // This feature cannot be enabled and disabled, it is either // available or not depending on the device. // This flag is here to allow applications to better determine // rendering quality. // D3DPRASTERCAPS_SUBPIXELX - // Support for subpixel placement is only available along the // X axis. // // Subpixel correction takes place along the X axis and is // clamped to an integer Y axis scan line. // D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT - // Translucency support is independant on the sort order of // polygons. // D3DPRASTERCAPS_WBUFFER - // Support for depth buffering using the w-buffer is // available. // D3DPRASTERCAPS_WFOG - // Support for w-buffer based fog is available. // D3DPRASTERCAPS_XOR - // Support for XOR operations is available. // // When D3DPRIM_RASTER_ROP2 is set then XOR operations must be // supported regardless of this flags value. // D3DPRASTERCAPS_ZBIAS - // Support for Z bias values is available. // // Z bias establishes a display order for images with the same // Z axis value. A good example of why you may wish to use Z // bias would be a shadow on a wall. Both occupy the same // depth, but by giving the shadow a higher Z bias than the // wall will give the right appearance without sorting. // D3DPRASTERCAPS_ZBUFFERLESSHSR - // Support for the removal of non visible (hidden) surfaces // without sorting polygons or allocating a z-buffer is // available. // // The technique used to perform hidden surface removal is // dependent on the hardware and is transparent to the // application. // // This kind of hidden surface removal takes place when the // rendering target surface has no Z buffer attached but the Z // buffer comparison test is still enabled. // D3DPRASTERCAPS_ZFOG - // Support for z-buffer based fog is available. // D3DPRASTERCAPS_ZTEST - // Support for Z test operations is available. // // This renders a virtual primitive and indicates whether any // pixels would have been rendered. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetRasterCaps() { return fD3DPRIMCAPS.dwRasterCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetRasterCaps( dword pRasterCaps ) { fD3DPRIMCAPS.dwRasterCaps = pRasterCaps; } // -------------------------------------------------------------------------- // Property: ShadeCaps // Description: The ShadeCaps property indicate the shading operations that // the device is capable of performing. // The described effect applies when the flag is set. // // Flat shade mode uses the specular and color component of the // first vertex in a triangle to shade the whole face. // Gouraud shade mode interpolates the color and intensity of // adjacent vertices across the space that separates them in a // linear fashion. // Phong shade mode calculates the appropriate shade value for // each pixel but is not yet supported in DirectX. // Monochrome shading modes use the specular component's blue // channel for the white intensity. // Any commands the device supports are assumed to also support // the flat shading mode. // When a mode doesn't support alpha components, alpha is // interpreted as being at maximum intensity (255). // // The color, specular highlights, fog, and alpha interpolants // of a triangle each have capability flags that an application // can use to find out how they are implemented by the device // driver. These are modified by the shading mode, color model, // and whether the alpha component of a color is blended or // stippled. // Flags: D3DPSHADECAPS_ALPHAFLATBLEND - // Support for an alpha component when flat shade mode // blending is available. // The alpha component of the first vertex is used for the // entire primitive. // D3DPSHADECAPS_ALPHAFLATSTIPPLED - // Support for an alpha component when flat shade mode // stippling is available. // The alpha component of the first vertex is used for the // entire primitive. // D3DPSHADECAPS_ALPHAGOURAUDBLEND - // Support for an alpha component when gouraud shade mode // blending is available. // The alpha component of adjacent vertices is interpolated // across the space between them in a linear fashion. // D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED - // Support for an alpha component when gouraud shade mode // stippling is available. // The alpha component of adjacent vertices is interpolated // across the space between them in a linear fashion. // D3DPSHADECAPS_ALPHAPHONGBLEND - // Support for an alpha component when phong shade mode // blending is available. // The alpha component of each pixel is calculated // individually. // // Phong shading is not available in Dx7. // D3DPSHADECAPS_ALPHAPHONGSTIPPLED - // Support for an alpha component when phong shade mode // stippling is available. // The alpha component of each pixel is calculated // individually. // // Phong shading is not available in Dx7. // D3DPSHADECAPS_COLORFLATMONO - // Support for monochrome flat shade mode blending is // available. // The blue component of the first vertex is used as a // greyscale value for the entire primitive. // D3DPSHADECAPS_COLORFLATRGB - // Support for colored flat shade mode blending is available. // The color components of the first vertex are used for the // entire primitive. // D3DPSHADECAPS_COLORGOURAUDMONO - // Support for monochrome gouraud shade mode blending is // available. // The blue component of adjacent vertices is used as a // greyscale value and interpolated across the space between // them in a linear fashion. // D3DPSHADECAPS_COLORGOURAUDRGB - // Support for color gouraud shade mode blending is available. // The color components of adjacent vertices are interpolated // across the space between them in a linear fashion. // D3DPSHADECAPS_COLORPHONGMONO - // Support for monochrome phong shade mode blending is // available. // The greyscale value of each pixel is calculated // individually. // // Phong shading is not available in Dx7. // D3DPSHADECAPS_COLORPHONGRGB - // Support for color phong shade mode blending is available. // The color components of each pixel are calculated // individually. // // Phong shading is not available in Dx7. // D3DPSHADECAPS_FOGFLAT - // Support for fog when using the flat shading mode is // available. // D3DPSHADECAPS_FOGGOURAUD - // Support for fog when using the gouraud shading mode is // available. // D3DPSHADECAPS_FOGPHONG - // Support for fog when using the phong shading mode is // available. // // Phong shading is not available in Dx7. // D3DPSHADECAPS_SPECULARFLATMONO - // Support for monochrome specular highlights when using the // flat shade mode is available. // D3DPSHADECAPS_SPECULARFLATRGB - // Support for colored specular highlights when using the flat // shade mode is available. // D3DPSHADECAPS_SPECULARGOURAUDMONO - // Support for monochrome specular highlights when using the // gouraud shade mode is available. // D3DPSHADECAPS_SPECULARGOURAUDRGB - // Support for colored specular highlights when using the // gouraud shade mode is available. // D3DPSHADECAPS_SPECULARPHONGMONO - // Support for monochrome specular highlights when using the // phong shade mode is available. // // Phong shading is not available in Dx7. // D3DPSHADECAPS_SPECULARPHONGRGB - // Support for colored specular highlights when using the // phong shade mode is available. // // Phong shading is not available in Dx7. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetShadeCaps() { return fD3DPRIMCAPS.dwShadeCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetShadeCaps( dword pShadeCaps ) { fD3DPRIMCAPS.dwShadeCaps = pShadeCaps; } // -------------------------------------------------------------------------- // Property: Size // Description: Contains the size, in bytes, of this object. // // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetSize() { return fD3DPRIMCAPS.dwSize; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetSize( dword pSize ) { fD3DPRIMCAPS.dwSize = pSize; } // -------------------------------------------------------------------------- // Property: SrcBlendCaps // Description: The SrcBlendCaps property indicate the source blending // capablilties that are available. // The described effect applies when the flag is set. // // Each component of the RGBA value is denoted by the // corresponding capitalised letter, source and destination // being indicated by s and d respectively. // Flags: D3DPBLENDCAPS_BOTHINVSRCALPHA - // Support for using the inverted source alpha value as the // source blend factor and the source alpha value as the // destination blend factor of is available. // Source blend factor: (1-As, 1-As, 1-As, 1-As) // Destination blend factor: (As, As, As, As) // The destination blend selection is overridden. // D3DPBLENDCAPS_DESTALPHA - // Support for using the destination alpha value as the blend // factor is available. // Blend factor: (Ad, Ad, Ad, Ad) // D3DPBLENDCAPS_DESTCOLOR - // Support for using the destination color as the blend factor // is available. // Blend factor: (Rd, Gd, Bd, Ad) // D3DPBLENDCAPS_INVDESTALPHA - // Support for using the inverted destination alpha value as // the blend factor is available. // Blend factor: (1-Ad, 1-Ad, 1-Ad, 1-Ad) // D3DPBLENDCAPS_INVDESTCOLOR - // Support for using the inverted destination color as the // blend factor is available. // Blend factor: (1-Rd, 1-Gd, 1-Bd, 1-Ad) // D3DPBLENDCAPS_INVSRCALPHA - // Support for using the inverted source alpha value as the // blend factor is available. // Blend factor: (1-As, 1-As, 1-As, 1-As) // D3DPBLENDCAPS_INVSRCCOLOR - // Support for using the inverted source color as the blend // factor is available. // Blend factor: (1-Rs, 1-Gs, 1-Bs, 1-As) // D3DPBLENDCAPS_ONE - // Support for a blend factor of 1 is available. // Blend factor: (1, 1, 1, 1) // D3DPBLENDCAPS_SRCALPHA - // Support for using the source alpha value as the blend // factor is available. // Blend factor: (As, As, As, As) // D3DPBLENDCAPS_SRCALPHASAT - // Support for using the lower of the source alpha value or // inverted destination alpha value as the blend factor is // available. // Blend factor: (min(As, 1-Ad), min(As, 1-Ad), min(As, 1-Ad), // 1) // D3DPBLENDCAPS_SRCCOLOR - // Support for using the source color as the blend factor is // available. // Blend factor: (Rs, Gs, Bs, As) // D3DPBLENDCAPS_ZERO - // Support for a blend factor of 0 is available. // Blend factor: (0, 0, 0, 0) // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetSrcBlendCaps() { return fD3DPRIMCAPS.dwSrcBlendCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetSrcBlendCaps( dword pSrcBlendCaps ) { fD3DPRIMCAPS.dwSrcBlendCaps = pSrcBlendCaps; } // -------------------------------------------------------------------------- // Property: StippleHeight // Description: The StippleHeight property defines the maximum stipple // pattern height supported. // This can have a maximum value of 32. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetStippleHeight() { return fD3DPRIMCAPS.dwStippleHeight; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetStippleHeight( dword pStippleHeight ) { fD3DPRIMCAPS.dwStippleHeight = pStippleHeight; } // -------------------------------------------------------------------------- // Property: StippleWidth // Description: The StippleWidth property defines the maximum stipple pattern // width supported. // This can have a maximum value of 32. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetStippleWidth() { return fD3DPRIMCAPS.dwStippleWidth; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetStippleWidth( dword pStippleWidth ) { fD3DPRIMCAPS.dwStippleWidth = pStippleWidth; } // -------------------------------------------------------------------------- // Property: TextureAddressCaps // Description: The TextureAddressCaps property indicates which texture // addressing capabilities are supported. // The described effect applies when the flag is set. // Flags: D3DPTADDRESSCAPS_BORDER - // Support for texture coordinates outside the range 0.0 to // 1.0 being set to a border color is available. // D3DPTADDRESSCAPS_CLAMP - // Support for texture clamping to addresses is available. // D3DPTADDRESSCAPS_INDEPENDENTUV - // Support for separate texture addressing modes for the U and // V texture coordinates is available. // D3DPTADDRESSCAPS_MIRROR - // Support for the mirroring of textures to addresses is // available. // // Mirrored texture addressing is like tiled texture // addressing except the texture is flipped every integer // junction, thus 0 to 1 may be addressed normally, 1 to 2 // would then be mirrored, 2 to 3 would be normal, etc. // D3DPTADDRESSCAPS_WRAP - // Support for wrapping textures to addresses is available. // // Wrapping allows the wrap around of texture coordinates in // the U, V or both directions. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetTextureAddressCaps() { return fD3DPRIMCAPS.dwTextureAddressCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetTextureAddressCaps( dword pTextureAddressCaps ) { fD3DPRIMCAPS.dwTextureAddressCaps = pTextureAddressCaps; } // -------------------------------------------------------------------------- // Property: TextureBlendCaps // Description: NOT USED // Texture blending capabilties are available through // TD3DDeviceDesc->TextureOpCaps. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetTextureBlendCaps() { return fD3DPRIMCAPS.dwTextureBlendCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetTextureBlendCaps( dword pTextureBlendCaps ) { fD3DPRIMCAPS.dwTextureBlendCaps = pTextureBlendCaps; } // -------------------------------------------------------------------------- // Property: TextureCaps // Description: The TextureCaps property flags indicates which texture // mapping capabilities are available. // The described effect applies when the flag is set. // Flags: D3DPTEXTURECAPS_ALPHA - // Support for RGBA textures when using decal and modulate // texture filtering modes is available. // // Regardless of this value, alpha must be supported in the // decal mask, decal alpha and modulate alpha filtering modes // if they are available. // D3DPTEXTURECAPS_ALPHAPALETTE - // Support for alpha palettized texture surfaces is available. // D3DPTEXTURECAPS_BORDER - // NOT USED // Superseded by the // TD3DPrimCaps::TextureAddressCaps.D3DPTADDRESSCAPS_BORDER // flag. // D3DPTEXTURECAPS_COLORKEYBLEND - // Support for alpha blended colorkeying is available. // D3DPTEXTURECAPS_CUBEMAP - // Support for cubic environment maps (cubemaps) is available. // D3DPTEXTURECAPS_NONPOW2CONDITIONAL - // Support for textures with dimensions that are not powers of // 2 is available. // // To use this capability, the addressing mode must be set to // D3DTADDRESS_CLAMP and texture wrapping disabled // (D3DRENDERSTATE_WRAPn = 0). // D3DPTEXTURECAPS_PERSPECTIVE - // Support for perspective correction is available. // D3DPTEXTURECAPS_POW2 - // The U and V texture dimensions must always be powers of // two. // D3DPTEXTURECAPS_PROJECTED - // Support for projected texture transforms is available. // // Setting the D3DTTFF_PROJECTED texture transformation flag // means transformed texture coordinates will be divided by // the last texture coordinate. // D3DPTEXTURECAPS_SQUAREONLY - // The U and V texture dimensions must always be equal. // D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE - // Support for not scaling texture idices by texture size // prior to interpolation is available. // D3DPTEXTURECAPS_TRANSPARENCY - // Support for texture transparency is available. // // Texture pixels that are the current transparent color are // not drawn. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetTextureCaps() { return fD3DPRIMCAPS.dwTextureCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetTextureCaps( dword pTextureCaps ) { fD3DPRIMCAPS.dwTextureCaps = pTextureCaps; } // -------------------------------------------------------------------------- // Property: TextureFilterCaps // Description: The TextureFilterCaps property indicates the texture map // filtering capabilities that are available. // The described effect applies when the flag is set. // Flags: D3DPTFILTERCAPS_LINEAR - // Support for bilinear filtering is available. // D3DPTFILTERCAPS_LINEARMIPLINEAR - // Support for trilinear interpolation between mipmaps is // available. // // Bilinear filtering of the two nearest mipmap pixels then // linear interpolation of the two resultant colors. // D3DPTFILTERCAPS_LINEARMIPNEAREST - // Support for linear interpolation between two mipmaps is // available. // // Linear interpolation of the two nearest mipmap pixels. // D3DPTFILTERCAPS_MAGFAFLATCUBIC - // Support for magnifying textures using per-stage flat cubic // filtering is available. // D3DPTFILTERCAPS_MAGFANISOTROPIC - // Support for magnifying textures using per-stage anisotropic // filtering is available. // D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC - // Support for magnifying textures using per-stage gausian // cubic filtering is available. // D3DPTFILTERCAPS_MAGFLINEAR - // Support for magnifying textures using per-stage bilinear // interpolation filtering is available. // D3DPTFILTERCAPS_MAGFPOINT - // Support for magnifying textures using per-stage point // sampled filtering is available. // D3DPTFILTERCAPS_MINFANISOTROPIC - // Support for minifying textures using per-stage anisotropic // filtering is available. // D3DPTFILTERCAPS_MINFLINEAR - // Support for minifying textures using per-stage bilinear // interpolation filtering is available. // D3DPTFILTERCAPS_MINFPOINT - // Support for minifying textures using per-stage point // sampled filtering is available. // D3DPTFILTERCAPS_MIPFLINEAR - // Support for per-stage trilinear interpolation filtering of // mipmaps is available. // D3DPTFILTERCAPS_MIPFPOINT - // Support for per-stage point sampled filtering of mipmaps is // available. // D3DPTFILTERCAPS_MIPLINEAR - // Support for bilinear filtering of the nearest mipmap pixel // is available. // D3DPTFILTERCAPS_MIPNEAREST - // Support for using the nearest mipmap pixel is available. // D3DPTFILTERCAPS_NEAREST - // Support for using the nearest texture pixel is available. // // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetTextureFilterCaps() { return fD3DPRIMCAPS.dwTextureFilterCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetTextureFilterCaps( dword pTextureFilterCaps ) { fD3DPRIMCAPS.dwTextureFilterCaps = pTextureFilterCaps; } // -------------------------------------------------------------------------- // Property: ZCmpCaps // Description: These flags indicate what Z buffer comparison functions are // available. // The described effect applies when the flag is set. // // Z comparisons determine whether or not to draw a z-buffered // pixel. // Flags: D3DPCMPCAPS_ALWAYS - // Z-comparisions are not supported and all z-comparisions // will be passed. // D3DPCMPCAPS_EQUAL - // Equality z-comparisons are available, the test being passed // if the new z-value is equal to the current z-value. // D3DPCMPCAPS_GREATER - // Greater than z-comparisions are available, the test being // passed if the new z-value is greater than the current // z-value. // D3DPCMPCAPS_GREATEREQUAL - // Greater than or equal to z-comparisons are available, the // test being passed if the new z-value is greater than or // equal to the current z-value. // D3DPCMPCAPS_LESS - // Less than z-comparisions are available, the test being // passed if the new z-value is less than the current z-value. // D3DPCMPCAPS_LESSEQUAL - // Less than or equal to z-comparisions are available, the // test being passed if the new z-value is less than or equal // to the current z-value. // D3DPCMPCAPS_NEVER - // Z-comparisions are unavailable and all z-comparisions will // be failed. // D3DPCMPCAPS_NOTEQUAL - // Not equal z-comparisions are available, the test being // passed if the new z-value is not equal to the current // z-value. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetZCmpCaps() { return fD3DPRIMCAPS.dwZCmpCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetZCmpCaps( dword pZCmpCaps ) { fD3DPRIMCAPS.dwZCmpCaps = pZCmpCaps; } // -------------------------------------------------------------------------- // Method: Clear() // Description: The Clear() method can be used to clear the contents of the // TD3DPrimCaps's internal D3DPRIMCAPS structure. // Note: if you have manually linked a structure member to a // chunk of memory, make sure you release this memory before // calling Clear(). // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::Clear() { fD3DPRIMCAPS.dwAlphaCmpCaps = 0; fD3DPRIMCAPS.dwDestBlendCaps = 0; fErrorValue = D3D_OK; fD3DPRIMCAPS.dwMiscCaps = 0; fD3DPRIMCAPS.dwRasterCaps = 0; fD3DPRIMCAPS.dwShadeCaps = 0; fD3DPRIMCAPS.dwSize = sizeof(D3DPRIMCAPS); fD3DPRIMCAPS.dwSrcBlendCaps = 0; fD3DPRIMCAPS.dwStippleHeight = 0; fD3DPRIMCAPS.dwStippleWidth = 0; fD3DPRIMCAPS.dwTextureAddressCaps = 0; fD3DPRIMCAPS.dwTextureBlendCaps = 0; fD3DPRIMCAPS.dwTextureCaps = 0; fD3DPRIMCAPS.dwTextureFilterCaps = 0; fD3DPRIMCAPS.dwZCmpCaps = 0; } // -------------------------------------------------------------------------- // Internal Structure Access // -------------------------------------------------------------------------- D3DPRIMCAPS* __fastcall TD3DPrimCaps::FGetInternal_D3DPRIMCAPS_Ptr() { return &fD3DPRIMCAPS; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetInternal_D3DPRIMCAPS( D3DPRIMCAPS* pD3DPRIMCAPS ) { if (pD3DPRIMCAPS==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FSetInternal_D3DPRIMCAPS()", "TDX_ERROR", "The supplied D3DPRIMCAPS* was NULL" ); return; } CopyMemory( &fD3DPRIMCAPS, pD3DPRIMCAPS, sizeof(D3DPRIMCAPS) ); Internal_D3DPRIMCAPS_Update(); } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::Internal_D3DPRIMCAPS_Update() { } // -------------------------------------------------------------------------- // Method: FGetAlphaCmpCaps_ // Description: This method returns a TD3DPrimCaps_AlphaCmpCaps_Set<> of the // flags in the current fD3DPRIMCAPS.dwAlphaCmpCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DPrimCaps_ZCmpCaps_Set __fastcall TD3DPrimCaps::FGetAlphaCmpCaps_() { TD3DPrimCaps_ZCmpCaps_Set TempAlphaCmpCaps_; TempAlphaCmpCaps_.Clear(); if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_ALWAYS) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_always; if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_EQUAL) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_equal; if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_GREATER) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_greater_; if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_GREATEREQUAL) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_greaterequal_; if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_LESS) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_less_; if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_LESSEQUAL) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_lessequal_; if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_NEVER) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_never; if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_NOTEQUAL) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_notequal; return TempAlphaCmpCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetAlphaCmpCaps_( TD3DPrimCaps_ZCmpCaps_Set pAlphaCmpCaps_ ) { fD3DPRIMCAPS.dwAlphaCmpCaps = 0; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_always)) fD3DPRIMCAPS.dwAlphaCmpCaps |= D3DPCMPCAPS_ALWAYS; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_equal)) fD3DPRIMCAPS.dwAlphaCmpCaps |= D3DPCMPCAPS_EQUAL; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_greater_)) fD3DPRIMCAPS.dwAlphaCmpCaps |= D3DPCMPCAPS_GREATER; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_greaterequal_)) fD3DPRIMCAPS.dwAlphaCmpCaps |= D3DPCMPCAPS_GREATEREQUAL; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_less_)) fD3DPRIMCAPS.dwAlphaCmpCaps |= D3DPCMPCAPS_LESS; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_lessequal_)) fD3DPRIMCAPS.dwAlphaCmpCaps |= D3DPCMPCAPS_LESSEQUAL; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_never)) fD3DPRIMCAPS.dwAlphaCmpCaps |= D3DPCMPCAPS_NEVER; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_notequal)) fD3DPRIMCAPS.dwAlphaCmpCaps |= D3DPCMPCAPS_NOTEQUAL; } // -------------------------------------------------------------------------- // Method: FGetAlphaCmpCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'AlphaCmpCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DPrimCaps::FGetAlphaCmpCaps_Strings() { // if the strings have not been allocated if (fAlphaCmpCaps_Strings==NULL) { // attempt to allocate the strings fAlphaCmpCaps_Strings = new TStringList(); // if the allocation failed if (fAlphaCmpCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FGetAlphaCmpCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various AlphaCmpCaps_Strings" ); return NULL; } } fAlphaCmpCaps_Strings->Clear(); if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_ALWAYS) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_ALWAYS"); if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_EQUAL) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_EQUAL"); if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_GREATER) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_GREATER"); if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_GREATEREQUAL) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_GREATEREQUAL"); if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_LESS) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_LESS"); if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_LESSEQUAL) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_LESSEQUAL"); if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_NEVER) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_NEVER"); if (fD3DPRIMCAPS.dwAlphaCmpCaps & D3DPCMPCAPS_NOTEQUAL) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_NOTEQUAL"); return fAlphaCmpCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetDestBlendCaps_ // Description: This method returns a TD3DPrimCaps_DestBlendCaps_Set<> of the // flags in the current fD3DPRIMCAPS.dwDestBlendCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DPrimCaps_SrcBlendCaps_Set __fastcall TD3DPrimCaps::FGetDestBlendCaps_() { TD3DPrimCaps_SrcBlendCaps_Set TempDestBlendCaps_; TempDestBlendCaps_.Clear(); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_BOTHINVSRCALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_bothinvsrcalpha; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_DESTALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_destalpha_; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_DESTCOLOR) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_destcolor_; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_INVDESTALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_invdestalpha; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_invdestcolor_; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_invsrcalpha_; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_INVSRCCOLOR) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_invsrccolor_; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_ONE) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_one_; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_SRCALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_srcalpha_; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_SRCALPHASAT) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_srcalphasat; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_SRCCOLOR) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_srccolor; if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_ZERO) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_zero; return TempDestBlendCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetDestBlendCaps_( TD3DPrimCaps_SrcBlendCaps_Set pDestBlendCaps_ ) { fD3DPRIMCAPS.dwDestBlendCaps = 0; if (pDestBlendCaps_.Contains(d3dpblendcaps_bothinvsrcalpha)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_BOTHINVSRCALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_destalpha_)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_DESTALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_destcolor_)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_DESTCOLOR; if (pDestBlendCaps_.Contains(d3dpblendcaps_invdestalpha)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_INVDESTALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_invdestcolor_)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_INVDESTCOLOR; if (pDestBlendCaps_.Contains(d3dpblendcaps_invsrcalpha_)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_INVSRCALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_invsrccolor_)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_INVSRCCOLOR; if (pDestBlendCaps_.Contains(d3dpblendcaps_one_)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_ONE; if (pDestBlendCaps_.Contains(d3dpblendcaps_srcalpha_)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_SRCALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_srcalphasat)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_SRCALPHASAT; if (pDestBlendCaps_.Contains(d3dpblendcaps_srccolor)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_SRCCOLOR; if (pDestBlendCaps_.Contains(d3dpblendcaps_zero)) fD3DPRIMCAPS.dwDestBlendCaps |= D3DPBLENDCAPS_ZERO; } // -------------------------------------------------------------------------- // Method: FGetDestBlendCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'DestBlendCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DPrimCaps::FGetDestBlendCaps_Strings() { // if the strings have not been allocated if (fDestBlendCaps_Strings==NULL) { // attempt to allocate the strings fDestBlendCaps_Strings = new TStringList(); // if the allocation failed if (fDestBlendCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FGetDestBlendCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various DestBlendCaps_Strings" ); return NULL; } } fDestBlendCaps_Strings->Clear(); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_BOTHINVSRCALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_BOTHINVSRCALPHA"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_DESTALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_DESTALPHA"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_DESTCOLOR) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_DESTCOLOR"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_INVDESTALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_INVDESTALPHA"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_INVDESTCOLOR"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_INVSRCALPHA"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_INVSRCCOLOR) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_INVSRCCOLOR"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_ONE) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_ONE"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_SRCALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCALPHA"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_SRCALPHASAT) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCALPHASAT"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_SRCCOLOR) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCCOLOR"); if (fD3DPRIMCAPS.dwDestBlendCaps & D3DPBLENDCAPS_ZERO) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_ZERO"); return fDestBlendCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetMiscCaps_ // Description: This method returns a TD3DPrimCaps_MiscCaps_Set<> of the // flags in the current fD3DPRIMCAPS.dwMiscCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DPrimCaps_MiscCaps_Set __fastcall TD3DPrimCaps::FGetMiscCaps_() { TD3DPrimCaps_MiscCaps_Set TempMiscCaps_; TempMiscCaps_.Clear(); if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_CONFORMANT) TempMiscCaps_ = TempMiscCaps_ << d3dpmisccaps_conformant; if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_CULLCCW) TempMiscCaps_ = TempMiscCaps_ << d3dpmisccaps_cullccw; if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_CULLCW) TempMiscCaps_ = TempMiscCaps_ << d3dpmisccaps_cullcw; if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_CULLNONE) TempMiscCaps_ = TempMiscCaps_ << d3dpmisccaps_cullnone; if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_LINEPATTERNREP) TempMiscCaps_ = TempMiscCaps_ << d3dpmisccaps_linepatternrep; if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_MASKPLANES) TempMiscCaps_ = TempMiscCaps_ << d3dpmisccaps_maskplanes; if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_MASKZ) TempMiscCaps_ = TempMiscCaps_ << d3dpmisccaps_maskz; return TempMiscCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetMiscCaps_( TD3DPrimCaps_MiscCaps_Set pMiscCaps_ ) { fD3DPRIMCAPS.dwMiscCaps = 0; if (pMiscCaps_.Contains(d3dpmisccaps_conformant)) fD3DPRIMCAPS.dwMiscCaps |= D3DPMISCCAPS_CONFORMANT; if (pMiscCaps_.Contains(d3dpmisccaps_cullccw)) fD3DPRIMCAPS.dwMiscCaps |= D3DPMISCCAPS_CULLCCW; if (pMiscCaps_.Contains(d3dpmisccaps_cullcw)) fD3DPRIMCAPS.dwMiscCaps |= D3DPMISCCAPS_CULLCW; if (pMiscCaps_.Contains(d3dpmisccaps_cullnone)) fD3DPRIMCAPS.dwMiscCaps |= D3DPMISCCAPS_CULLNONE; if (pMiscCaps_.Contains(d3dpmisccaps_linepatternrep)) fD3DPRIMCAPS.dwMiscCaps |= D3DPMISCCAPS_LINEPATTERNREP; if (pMiscCaps_.Contains(d3dpmisccaps_maskplanes)) fD3DPRIMCAPS.dwMiscCaps |= D3DPMISCCAPS_MASKPLANES; if (pMiscCaps_.Contains(d3dpmisccaps_maskz)) fD3DPRIMCAPS.dwMiscCaps |= D3DPMISCCAPS_MASKZ; } // -------------------------------------------------------------------------- // Method: FGetMiscCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'MiscCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DPrimCaps::FGetMiscCaps_Strings() { // if the strings have not been allocated if (fMiscCaps_Strings==NULL) { // attempt to allocate the strings fMiscCaps_Strings = new TStringList(); // if the allocation failed if (fMiscCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FGetMiscCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various MiscCaps_Strings" ); return NULL; } } fMiscCaps_Strings->Clear(); if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_CONFORMANT) fMiscCaps_Strings->Add("D3DPMISCCAPS_CONFORMANT"); if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_CULLCCW) fMiscCaps_Strings->Add("D3DPMISCCAPS_CULLCCW"); if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_CULLCW) fMiscCaps_Strings->Add("D3DPMISCCAPS_CULLCW"); if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_CULLNONE) fMiscCaps_Strings->Add("D3DPMISCCAPS_CULLNONE"); if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_LINEPATTERNREP) fMiscCaps_Strings->Add("D3DPMISCCAPS_LINEPATTERNREP"); if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_MASKPLANES) fMiscCaps_Strings->Add("D3DPMISCCAPS_MASKPLANES"); if (fD3DPRIMCAPS.dwMiscCaps & D3DPMISCCAPS_MASKZ) fMiscCaps_Strings->Add("D3DPMISCCAPS_MASKZ"); return fMiscCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetRasterCaps_ // Description: This method returns a TD3DPrimCaps_RasterCaps_Set<> of the // flags in the current fD3DPRIMCAPS.dwRasterCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DPrimCaps_RasterCaps_Set __fastcall TD3DPrimCaps::FGetRasterCaps_() { TD3DPrimCaps_RasterCaps_Set TempRasterCaps_; TempRasterCaps_.Clear(); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ANISOTROPY) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_anisotropy; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_antialiasedges; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_antialiassortdependent; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_antialiassortindependent; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_DITHER) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_dither; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_FOGRANGE) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_fogrange; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_fogtable; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_FOGVERTEX) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_fogvertex; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_MIPMAPLODBIAS) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_mipmaplodbias; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_PAT) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_pat; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ROP2) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_rop2; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_STIPPLE) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_stipple; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_SUBPIXEL) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_subpixel; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_SUBPIXELX) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_subpixelx; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_translucentsortindependent; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_WBUFFER) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_wbuffer; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_WFOG) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_wfog; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_XOR) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_xor; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ZBIAS) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_zbias; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ZBUFFERLESSHSR) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_zbufferlesshsr; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ZFOG) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_zfog; if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ZTEST) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_ztest; return TempRasterCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetRasterCaps_( TD3DPrimCaps_RasterCaps_Set pRasterCaps_ ) { fD3DPRIMCAPS.dwRasterCaps = 0; if (pRasterCaps_.Contains(d3dprastercaps_anisotropy)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_ANISOTROPY; if (pRasterCaps_.Contains(d3dprastercaps_antialiasedges)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_ANTIALIASEDGES; if (pRasterCaps_.Contains(d3dprastercaps_antialiassortdependent)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT; if (pRasterCaps_.Contains(d3dprastercaps_antialiassortindependent)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT; if (pRasterCaps_.Contains(d3dprastercaps_dither)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_DITHER; if (pRasterCaps_.Contains(d3dprastercaps_fogrange)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_FOGRANGE; if (pRasterCaps_.Contains(d3dprastercaps_fogtable)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_FOGTABLE; if (pRasterCaps_.Contains(d3dprastercaps_fogvertex)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_FOGVERTEX; if (pRasterCaps_.Contains(d3dprastercaps_mipmaplodbias)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_MIPMAPLODBIAS; if (pRasterCaps_.Contains(d3dprastercaps_pat)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_PAT; if (pRasterCaps_.Contains(d3dprastercaps_rop2)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_ROP2; if (pRasterCaps_.Contains(d3dprastercaps_stipple)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_STIPPLE; if (pRasterCaps_.Contains(d3dprastercaps_subpixel)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_SUBPIXEL; if (pRasterCaps_.Contains(d3dprastercaps_subpixelx)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_SUBPIXELX; if (pRasterCaps_.Contains(d3dprastercaps_translucentsortindependent)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT; if (pRasterCaps_.Contains(d3dprastercaps_wbuffer)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_WBUFFER; if (pRasterCaps_.Contains(d3dprastercaps_wfog)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_WFOG; if (pRasterCaps_.Contains(d3dprastercaps_xor)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_XOR; if (pRasterCaps_.Contains(d3dprastercaps_zbias)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_ZBIAS; if (pRasterCaps_.Contains(d3dprastercaps_zbufferlesshsr)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_ZBUFFERLESSHSR; if (pRasterCaps_.Contains(d3dprastercaps_zfog)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_ZFOG; if (pRasterCaps_.Contains(d3dprastercaps_ztest)) fD3DPRIMCAPS.dwRasterCaps |= D3DPRASTERCAPS_ZTEST; } // -------------------------------------------------------------------------- // Method: FGetRasterCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'RasterCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DPrimCaps::FGetRasterCaps_Strings() { // if the strings have not been allocated if (fRasterCaps_Strings==NULL) { // attempt to allocate the strings fRasterCaps_Strings = new TStringList(); // if the allocation failed if (fRasterCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FGetRasterCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various RasterCaps_Strings" ); return NULL; } } fRasterCaps_Strings->Clear(); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ANISOTROPY) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ANISOTROPY"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ANTIALIASEDGES"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_DITHER) fRasterCaps_Strings->Add("D3DPRASTERCAPS_DITHER"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_FOGRANGE) fRasterCaps_Strings->Add("D3DPRASTERCAPS_FOGRANGE"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE) fRasterCaps_Strings->Add("D3DPRASTERCAPS_FOGTABLE"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_FOGVERTEX) fRasterCaps_Strings->Add("D3DPRASTERCAPS_FOGVERTEX"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_MIPMAPLODBIAS) fRasterCaps_Strings->Add("D3DPRASTERCAPS_MIPMAPLODBIAS"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_PAT) fRasterCaps_Strings->Add("D3DPRASTERCAPS_PAT"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ROP2) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ROP2"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_STIPPLE) fRasterCaps_Strings->Add("D3DPRASTERCAPS_STIPPLE"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_SUBPIXEL) fRasterCaps_Strings->Add("D3DPRASTERCAPS_SUBPIXEL"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_SUBPIXELX) fRasterCaps_Strings->Add("D3DPRASTERCAPS_SUBPIXELX"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT) fRasterCaps_Strings->Add("D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_WBUFFER) fRasterCaps_Strings->Add("D3DPRASTERCAPS_WBUFFER"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_WFOG) fRasterCaps_Strings->Add("D3DPRASTERCAPS_WFOG"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_XOR) fRasterCaps_Strings->Add("D3DPRASTERCAPS_XOR"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ZBIAS) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ZBIAS"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ZBUFFERLESSHSR) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ZBUFFERLESSHSR"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ZFOG) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ZFOG"); if (fD3DPRIMCAPS.dwRasterCaps & D3DPRASTERCAPS_ZTEST) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ZTEST"); return fRasterCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetShadeCaps_ // Description: This method returns a TD3DPrimCaps_ShadeCaps_Set<> of the // flags in the current fD3DPRIMCAPS.dwShadeCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DPrimCaps_ShadeCaps_Set __fastcall TD3DPrimCaps::FGetShadeCaps_() { TD3DPrimCaps_ShadeCaps_Set TempShadeCaps_; TempShadeCaps_.Clear(); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAFLATBLEND) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_alphaflatblend; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAFLATSTIPPLED) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_alphaflatstippled; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAGOURAUDBLEND) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_alphagouraudblend; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_alphagouraudstippled; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAPHONGBLEND) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_alphaphongblend; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAPHONGSTIPPLED) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_alphaphongstippled; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORFLATMONO) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_colorflatmono; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORFLATRGB) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_colorflatrgb; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORGOURAUDMONO) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_colorgouraudmono; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORGOURAUDRGB) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_colorgouraudrgb; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORPHONGMONO) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_colorphongmono; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORPHONGRGB) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_colorphongrgb; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_FOGFLAT) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_fogflat; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_FOGGOURAUD) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_foggouraud; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_FOGPHONG) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_fogphong; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARFLATMONO) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_specularflatmono; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARFLATRGB) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_specularflatrgb; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARGOURAUDMONO) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_speculargouraudmono; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARGOURAUDRGB) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_speculargouraudrgb; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARPHONGMONO) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_specularphongmono; if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARPHONGRGB) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_specularphongrgb; return TempShadeCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetShadeCaps_( TD3DPrimCaps_ShadeCaps_Set pShadeCaps_ ) { fD3DPRIMCAPS.dwShadeCaps = 0; if (pShadeCaps_.Contains(d3dpshadecaps_alphaflatblend)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_ALPHAFLATBLEND; if (pShadeCaps_.Contains(d3dpshadecaps_alphaflatstippled)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_ALPHAFLATSTIPPLED; if (pShadeCaps_.Contains(d3dpshadecaps_alphagouraudblend)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_ALPHAGOURAUDBLEND; if (pShadeCaps_.Contains(d3dpshadecaps_alphagouraudstippled)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED; if (pShadeCaps_.Contains(d3dpshadecaps_alphaphongblend)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_ALPHAPHONGBLEND; if (pShadeCaps_.Contains(d3dpshadecaps_alphaphongstippled)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_ALPHAPHONGSTIPPLED; if (pShadeCaps_.Contains(d3dpshadecaps_colorflatmono)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_COLORFLATMONO; if (pShadeCaps_.Contains(d3dpshadecaps_colorflatrgb)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_COLORFLATRGB; if (pShadeCaps_.Contains(d3dpshadecaps_colorgouraudmono)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_COLORGOURAUDMONO; if (pShadeCaps_.Contains(d3dpshadecaps_colorgouraudrgb)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_COLORGOURAUDRGB; if (pShadeCaps_.Contains(d3dpshadecaps_colorphongmono)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_COLORPHONGMONO; if (pShadeCaps_.Contains(d3dpshadecaps_colorphongrgb)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_COLORPHONGRGB; if (pShadeCaps_.Contains(d3dpshadecaps_fogflat)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_FOGFLAT; if (pShadeCaps_.Contains(d3dpshadecaps_foggouraud)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_FOGGOURAUD; if (pShadeCaps_.Contains(d3dpshadecaps_fogphong)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_FOGPHONG; if (pShadeCaps_.Contains(d3dpshadecaps_specularflatmono)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_SPECULARFLATMONO; if (pShadeCaps_.Contains(d3dpshadecaps_specularflatrgb)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_SPECULARFLATRGB; if (pShadeCaps_.Contains(d3dpshadecaps_speculargouraudmono)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_SPECULARGOURAUDMONO; if (pShadeCaps_.Contains(d3dpshadecaps_speculargouraudrgb)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_SPECULARGOURAUDRGB; if (pShadeCaps_.Contains(d3dpshadecaps_specularphongmono)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_SPECULARPHONGMONO; if (pShadeCaps_.Contains(d3dpshadecaps_specularphongrgb)) fD3DPRIMCAPS.dwShadeCaps |= D3DPSHADECAPS_SPECULARPHONGRGB; } // -------------------------------------------------------------------------- // Method: FGetShadeCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'ShadeCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DPrimCaps::FGetShadeCaps_Strings() { // if the strings have not been allocated if (fShadeCaps_Strings==NULL) { // attempt to allocate the strings fShadeCaps_Strings = new TStringList(); // if the allocation failed if (fShadeCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FGetShadeCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various ShadeCaps_Strings" ); return NULL; } } fShadeCaps_Strings->Clear(); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAFLATBLEND) fShadeCaps_Strings->Add("D3DPSHADECAPS_ALPHAFLATBLEND"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAFLATSTIPPLED) fShadeCaps_Strings->Add("D3DPSHADECAPS_ALPHAFLATSTIPPLED"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAGOURAUDBLEND) fShadeCaps_Strings->Add("D3DPSHADECAPS_ALPHAGOURAUDBLEND"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED) fShadeCaps_Strings->Add("D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAPHONGBLEND) fShadeCaps_Strings->Add("D3DPSHADECAPS_ALPHAPHONGBLEND"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_ALPHAPHONGSTIPPLED) fShadeCaps_Strings->Add("D3DPSHADECAPS_ALPHAPHONGSTIPPLED"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORFLATMONO) fShadeCaps_Strings->Add("D3DPSHADECAPS_COLORFLATMONO"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORFLATRGB) fShadeCaps_Strings->Add("D3DPSHADECAPS_COLORFLATRGB"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORGOURAUDMONO) fShadeCaps_Strings->Add("D3DPSHADECAPS_COLORGOURAUDMONO"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORGOURAUDRGB) fShadeCaps_Strings->Add("D3DPSHADECAPS_COLORGOURAUDRGB"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORPHONGMONO) fShadeCaps_Strings->Add("D3DPSHADECAPS_COLORPHONGMONO"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_COLORPHONGRGB) fShadeCaps_Strings->Add("D3DPSHADECAPS_COLORPHONGRGB"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_FOGFLAT) fShadeCaps_Strings->Add("D3DPSHADECAPS_FOGFLAT"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_FOGGOURAUD) fShadeCaps_Strings->Add("D3DPSHADECAPS_FOGGOURAUD"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_FOGPHONG) fShadeCaps_Strings->Add("D3DPSHADECAPS_FOGPHONG"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARFLATMONO) fShadeCaps_Strings->Add("D3DPSHADECAPS_SPECULARFLATMONO"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARFLATRGB) fShadeCaps_Strings->Add("D3DPSHADECAPS_SPECULARFLATRGB"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARGOURAUDMONO) fShadeCaps_Strings->Add("D3DPSHADECAPS_SPECULARGOURAUDMONO"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARGOURAUDRGB) fShadeCaps_Strings->Add("D3DPSHADECAPS_SPECULARGOURAUDRGB"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARPHONGMONO) fShadeCaps_Strings->Add("D3DPSHADECAPS_SPECULARPHONGMONO"); if (fD3DPRIMCAPS.dwShadeCaps & D3DPSHADECAPS_SPECULARPHONGRGB) fShadeCaps_Strings->Add("D3DPSHADECAPS_SPECULARPHONGRGB"); return fShadeCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetSrcBlendCaps_ // Description: This method returns a TD3DPrimCaps_SrcBlendCaps_Set<> of the // flags in the current fD3DPRIMCAPS.dwSrcBlendCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DPrimCaps_SrcBlendCaps_Set __fastcall TD3DPrimCaps::FGetSrcBlendCaps_() { TD3DPrimCaps_SrcBlendCaps_Set TempSrcBlendCaps_; TempSrcBlendCaps_.Clear(); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_BOTHINVSRCALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_bothinvsrcalpha; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_DESTALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_destalpha_; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_DESTCOLOR) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_destcolor_; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_INVDESTALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_invdestalpha; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_invdestcolor_; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_invsrcalpha_; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_INVSRCCOLOR) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_invsrccolor_; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_ONE) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_one_; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_SRCALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_srcalpha_; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_SRCALPHASAT) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_srcalphasat; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_SRCCOLOR) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_srccolor; if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_ZERO) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_zero; return TempSrcBlendCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetSrcBlendCaps_( TD3DPrimCaps_SrcBlendCaps_Set pSrcBlendCaps_ ) { fD3DPRIMCAPS.dwSrcBlendCaps = 0; if (pSrcBlendCaps_.Contains(d3dpblendcaps_bothinvsrcalpha)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_BOTHINVSRCALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_destalpha_)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_DESTALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_destcolor_)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_DESTCOLOR; if (pSrcBlendCaps_.Contains(d3dpblendcaps_invdestalpha)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_INVDESTALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_invdestcolor_)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_INVDESTCOLOR; if (pSrcBlendCaps_.Contains(d3dpblendcaps_invsrcalpha_)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_INVSRCALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_invsrccolor_)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_INVSRCCOLOR; if (pSrcBlendCaps_.Contains(d3dpblendcaps_one_)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_ONE; if (pSrcBlendCaps_.Contains(d3dpblendcaps_srcalpha_)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_SRCALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_srcalphasat)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_SRCALPHASAT; if (pSrcBlendCaps_.Contains(d3dpblendcaps_srccolor)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_SRCCOLOR; if (pSrcBlendCaps_.Contains(d3dpblendcaps_zero)) fD3DPRIMCAPS.dwSrcBlendCaps |= D3DPBLENDCAPS_ZERO; } // -------------------------------------------------------------------------- // Method: FGetSrcBlendCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'SrcBlendCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DPrimCaps::FGetSrcBlendCaps_Strings() { // if the strings have not been allocated if (fSrcBlendCaps_Strings==NULL) { // attempt to allocate the strings fSrcBlendCaps_Strings = new TStringList(); // if the allocation failed if (fSrcBlendCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FGetSrcBlendCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various SrcBlendCaps_Strings" ); return NULL; } } fSrcBlendCaps_Strings->Clear(); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_BOTHINVSRCALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_BOTHINVSRCALPHA"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_DESTALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_DESTALPHA"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_DESTCOLOR) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_DESTCOLOR"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_INVDESTALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_INVDESTALPHA"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_INVDESTCOLOR"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_INVSRCALPHA"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_INVSRCCOLOR) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_INVSRCCOLOR"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_ONE) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_ONE"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_SRCALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCALPHA"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_SRCALPHASAT) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCALPHASAT"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_SRCCOLOR) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCCOLOR"); if (fD3DPRIMCAPS.dwSrcBlendCaps & D3DPBLENDCAPS_ZERO) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_ZERO"); return fSrcBlendCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetTextureAddressCaps_ // Description: This method returns a TD3DPrimCaps_TextureAddressCaps_Set<> // of the flags in the current // fD3DPRIMCAPS.dwTextureAddressCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DPrimCaps_TextureAddressCaps_Set __fastcall TD3DPrimCaps::FGetTextureAddressCaps_() { TD3DPrimCaps_TextureAddressCaps_Set TempTextureAddressCaps_; TempTextureAddressCaps_.Clear(); if (fD3DPRIMCAPS.dwTextureAddressCaps & D3DPTADDRESSCAPS_BORDER) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_border; if (fD3DPRIMCAPS.dwTextureAddressCaps & D3DPTADDRESSCAPS_CLAMP) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_clamp; if (fD3DPRIMCAPS.dwTextureAddressCaps & D3DPTADDRESSCAPS_INDEPENDENTUV) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_independentuv; if (fD3DPRIMCAPS.dwTextureAddressCaps & D3DPTADDRESSCAPS_MIRROR) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_mirror; if (fD3DPRIMCAPS.dwTextureAddressCaps & D3DPTADDRESSCAPS_WRAP) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_wrap; return TempTextureAddressCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetTextureAddressCaps_( TD3DPrimCaps_TextureAddressCaps_Set pTextureAddressCaps_ ) { fD3DPRIMCAPS.dwTextureAddressCaps = 0; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_border)) fD3DPRIMCAPS.dwTextureAddressCaps |= D3DPTADDRESSCAPS_BORDER; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_clamp)) fD3DPRIMCAPS.dwTextureAddressCaps |= D3DPTADDRESSCAPS_CLAMP; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_independentuv)) fD3DPRIMCAPS.dwTextureAddressCaps |= D3DPTADDRESSCAPS_INDEPENDENTUV; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_mirror)) fD3DPRIMCAPS.dwTextureAddressCaps |= D3DPTADDRESSCAPS_MIRROR; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_wrap)) fD3DPRIMCAPS.dwTextureAddressCaps |= D3DPTADDRESSCAPS_WRAP; } // -------------------------------------------------------------------------- // Method: FGetTextureAddressCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'TextureAddressCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DPrimCaps::FGetTextureAddressCaps_Strings() { // if the strings have not been allocated if (fTextureAddressCaps_Strings==NULL) { // attempt to allocate the strings fTextureAddressCaps_Strings = new TStringList(); // if the allocation failed if (fTextureAddressCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FGetTextureAddressCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various TextureAddressCaps_Strings" ); return NULL; } } fTextureAddressCaps_Strings->Clear(); if (fD3DPRIMCAPS.dwTextureAddressCaps & D3DPTADDRESSCAPS_BORDER) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_BORDER"); if (fD3DPRIMCAPS.dwTextureAddressCaps & D3DPTADDRESSCAPS_CLAMP) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_CLAMP"); if (fD3DPRIMCAPS.dwTextureAddressCaps & D3DPTADDRESSCAPS_INDEPENDENTUV) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_INDEPENDENTUV"); if (fD3DPRIMCAPS.dwTextureAddressCaps & D3DPTADDRESSCAPS_MIRROR) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_MIRROR"); if (fD3DPRIMCAPS.dwTextureAddressCaps & D3DPTADDRESSCAPS_WRAP) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_WRAP"); return fTextureAddressCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetTextureCaps_ // Description: This method returns a TD3DPrimCaps_TextureCaps_Set<> of the // flags in the current fD3DPRIMCAPS.dwTextureCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DPrimCaps_TextureCaps_Set __fastcall TD3DPrimCaps::FGetTextureCaps_() { TD3DPrimCaps_TextureCaps_Set TempTextureCaps_; TempTextureCaps_.Clear(); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_ALPHA) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_alpha; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_alphapalette; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_BORDER) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_border; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_COLORKEYBLEND) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_colorkeyblend; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_CUBEMAP) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_cubemap; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_nonpow2conditional; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_perspective; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_POW2) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_pow2; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_PROJECTED) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_projected; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_squareonly; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_texrepeatnotscaledbysize; if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_TRANSPARENCY) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_transparency; return TempTextureCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetTextureCaps_( TD3DPrimCaps_TextureCaps_Set pTextureCaps_ ) { fD3DPRIMCAPS.dwTextureCaps = 0; if (pTextureCaps_.Contains(d3dptexturecaps_alpha)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_ALPHA; if (pTextureCaps_.Contains(d3dptexturecaps_alphapalette)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_ALPHAPALETTE; if (pTextureCaps_.Contains(d3dptexturecaps_border)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_BORDER; if (pTextureCaps_.Contains(d3dptexturecaps_colorkeyblend)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_COLORKEYBLEND; if (pTextureCaps_.Contains(d3dptexturecaps_cubemap)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_CUBEMAP; if (pTextureCaps_.Contains(d3dptexturecaps_nonpow2conditional)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_NONPOW2CONDITIONAL; if (pTextureCaps_.Contains(d3dptexturecaps_perspective)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_PERSPECTIVE; if (pTextureCaps_.Contains(d3dptexturecaps_pow2)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_POW2; if (pTextureCaps_.Contains(d3dptexturecaps_projected)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_PROJECTED; if (pTextureCaps_.Contains(d3dptexturecaps_squareonly)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_SQUAREONLY; if (pTextureCaps_.Contains(d3dptexturecaps_texrepeatnotscaledbysize)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE; if (pTextureCaps_.Contains(d3dptexturecaps_transparency)) fD3DPRIMCAPS.dwTextureCaps |= D3DPTEXTURECAPS_TRANSPARENCY; } // -------------------------------------------------------------------------- // Method: FGetTextureCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'TextureCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DPrimCaps::FGetTextureCaps_Strings() { // if the strings have not been allocated if (fTextureCaps_Strings==NULL) { // attempt to allocate the strings fTextureCaps_Strings = new TStringList(); // if the allocation failed if (fTextureCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FGetTextureCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various TextureCaps_Strings" ); return NULL; } } fTextureCaps_Strings->Clear(); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_ALPHA) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_ALPHA"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_ALPHAPALETTE"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_BORDER) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_BORDER"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_COLORKEYBLEND) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_COLORKEYBLEND"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_CUBEMAP) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_CUBEMAP"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_NONPOW2CONDITIONAL"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_PERSPECTIVE"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_POW2) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_POW2"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_PROJECTED) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_PROJECTED"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_SQUAREONLY"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE"); if (fD3DPRIMCAPS.dwTextureCaps & D3DPTEXTURECAPS_TRANSPARENCY) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_TRANSPARENCY"); return fTextureCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetTextureFilterCaps_ // Description: This method returns a TD3DPrimCaps_TextureFilterCaps_Set<> of // the flags in the current fD3DPRIMCAPS.dwTextureFilterCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DPrimCaps_TextureFilterCaps_Set __fastcall TD3DPrimCaps::FGetTextureFilterCaps_() { TD3DPrimCaps_TextureFilterCaps_Set TempTextureFilterCaps_; TempTextureFilterCaps_.Clear(); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_LINEAR) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_linear; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_LINEARMIPLINEAR) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_linearmiplinear; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_LINEARMIPNEAREST) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_linearmipnearest; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MAGFAFLATCUBIC) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_magfaflatcubic; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_magfanisotropic; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_magfgaussiancubic; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_magflinear; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MAGFPOINT) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_magfpoint; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_minfanisotropic; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_minflinear; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MINFPOINT) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_minfpoint; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MIPFLINEAR) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_mipflinear; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MIPFPOINT) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_mipfpoint; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MIPLINEAR) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_miplinear; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MIPNEAREST) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_mipnearest; if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_NEAREST) TempTextureFilterCaps_ = TempTextureFilterCaps_ << d3dptfiltercaps_nearest; return TempTextureFilterCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetTextureFilterCaps_( TD3DPrimCaps_TextureFilterCaps_Set pTextureFilterCaps_ ) { fD3DPRIMCAPS.dwTextureFilterCaps = 0; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_linear)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_LINEAR; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_linearmiplinear)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_LINEARMIPLINEAR; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_linearmipnearest)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_LINEARMIPNEAREST; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_magfaflatcubic)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MAGFAFLATCUBIC; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_magfanisotropic)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MAGFANISOTROPIC; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_magfgaussiancubic)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_magflinear)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MAGFLINEAR; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_magfpoint)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MAGFPOINT; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_minfanisotropic)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MINFANISOTROPIC; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_minflinear)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MINFLINEAR; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_minfpoint)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MINFPOINT; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_mipflinear)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MIPFLINEAR; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_mipfpoint)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MIPFPOINT; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_miplinear)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MIPLINEAR; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_mipnearest)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_MIPNEAREST; if (pTextureFilterCaps_.Contains(d3dptfiltercaps_nearest)) fD3DPRIMCAPS.dwTextureFilterCaps |= D3DPTFILTERCAPS_NEAREST; } // -------------------------------------------------------------------------- // Method: FGetTextureFilterCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'TextureFilterCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DPrimCaps::FGetTextureFilterCaps_Strings() { // if the strings have not been allocated if (fTextureFilterCaps_Strings==NULL) { // attempt to allocate the strings fTextureFilterCaps_Strings = new TStringList(); // if the allocation failed if (fTextureFilterCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FGetTextureFilterCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various TextureFilterCaps_Strings" ); return NULL; } } fTextureFilterCaps_Strings->Clear(); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_LINEAR) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_LINEAR"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_LINEARMIPLINEAR) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_LINEARMIPLINEAR"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_LINEARMIPNEAREST) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_LINEARMIPNEAREST"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MAGFAFLATCUBIC) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MAGFAFLATCUBIC"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MAGFANISOTROPIC"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MAGFLINEAR"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MAGFPOINT) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MAGFPOINT"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MINFANISOTROPIC"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MINFLINEAR"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MINFPOINT) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MINFPOINT"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MIPFLINEAR) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MIPFLINEAR"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MIPFPOINT) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MIPFPOINT"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MIPLINEAR) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MIPLINEAR"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_MIPNEAREST) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_MIPNEAREST"); if (fD3DPRIMCAPS.dwTextureFilterCaps & D3DPTFILTERCAPS_NEAREST) fTextureFilterCaps_Strings->Add("D3DPTFILTERCAPS_NEAREST"); return fTextureFilterCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetZCmpCaps_ // Description: This method returns a TD3DPrimCaps_ZCmpCaps_Set<> of the // flags in the current fD3DPRIMCAPS.dwZCmpCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DPrimCaps_ZCmpCaps_Set __fastcall TD3DPrimCaps::FGetZCmpCaps_() { TD3DPrimCaps_ZCmpCaps_Set TempZCmpCaps_; TempZCmpCaps_.Clear(); if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_ALWAYS) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_always; if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_EQUAL) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_equal; if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_GREATER) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_greater_; if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_GREATEREQUAL) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_greaterequal_; if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_LESS) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_less_; if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_LESSEQUAL) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_lessequal_; if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_NEVER) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_never; if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_NOTEQUAL) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_notequal; return TempZCmpCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetZCmpCaps_( TD3DPrimCaps_ZCmpCaps_Set pZCmpCaps_ ) { fD3DPRIMCAPS.dwZCmpCaps = 0; if (pZCmpCaps_.Contains(d3dpcmpcaps_always)) fD3DPRIMCAPS.dwZCmpCaps |= D3DPCMPCAPS_ALWAYS; if (pZCmpCaps_.Contains(d3dpcmpcaps_equal)) fD3DPRIMCAPS.dwZCmpCaps |= D3DPCMPCAPS_EQUAL; if (pZCmpCaps_.Contains(d3dpcmpcaps_greater_)) fD3DPRIMCAPS.dwZCmpCaps |= D3DPCMPCAPS_GREATER; if (pZCmpCaps_.Contains(d3dpcmpcaps_greaterequal_)) fD3DPRIMCAPS.dwZCmpCaps |= D3DPCMPCAPS_GREATEREQUAL; if (pZCmpCaps_.Contains(d3dpcmpcaps_less_)) fD3DPRIMCAPS.dwZCmpCaps |= D3DPCMPCAPS_LESS; if (pZCmpCaps_.Contains(d3dpcmpcaps_lessequal_)) fD3DPRIMCAPS.dwZCmpCaps |= D3DPCMPCAPS_LESSEQUAL; if (pZCmpCaps_.Contains(d3dpcmpcaps_never)) fD3DPRIMCAPS.dwZCmpCaps |= D3DPCMPCAPS_NEVER; if (pZCmpCaps_.Contains(d3dpcmpcaps_notequal)) fD3DPRIMCAPS.dwZCmpCaps |= D3DPCMPCAPS_NOTEQUAL; } // -------------------------------------------------------------------------- // Method: FGetZCmpCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'ZCmpCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DPrimCaps::FGetZCmpCaps_Strings() { // if the strings have not been allocated if (fZCmpCaps_Strings==NULL) { // attempt to allocate the strings fZCmpCaps_Strings = new TStringList(); // if the allocation failed if (fZCmpCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DPrimCaps::FGetZCmpCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various ZCmpCaps_Strings" ); return NULL; } } fZCmpCaps_Strings->Clear(); if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_ALWAYS) fZCmpCaps_Strings->Add("D3DPCMPCAPS_ALWAYS"); if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_EQUAL) fZCmpCaps_Strings->Add("D3DPCMPCAPS_EQUAL"); if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_GREATER) fZCmpCaps_Strings->Add("D3DPCMPCAPS_GREATER"); if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_GREATEREQUAL) fZCmpCaps_Strings->Add("D3DPCMPCAPS_GREATEREQUAL"); if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_LESS) fZCmpCaps_Strings->Add("D3DPCMPCAPS_LESS"); if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_LESSEQUAL) fZCmpCaps_Strings->Add("D3DPCMPCAPS_LESSEQUAL"); if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_NEVER) fZCmpCaps_Strings->Add("D3DPCMPCAPS_NEVER"); if (fD3DPRIMCAPS.dwZCmpCaps & D3DPCMPCAPS_NOTEQUAL) fZCmpCaps_Strings->Add("D3DPCMPCAPS_NOTEQUAL"); return fZCmpCaps_Strings; } // --------------------------------------------------------------------------