// -------------------------------------------------------------------------- // ========================================================================== // 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) 2002 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: These flags indicate the alpha test comparison functions that // the driver is capable of performing. // Note: The possible values these flags can have are basically // the same as those described for the ZCmpCaps property of this // object. // If this property is zero, the driver does not support alpha // tests. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetAlphaCmpCaps() { return fD3DPRIMCAPS.dwAlphaCmpCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetAlphaCmpCaps( dword pAlphaCmpCaps ) { fD3DPRIMCAPS.dwAlphaCmpCaps = pAlphaCmpCaps; } // -------------------------------------------------------------------------- // Property: DestBlendCaps // Description: These flags indicate the destination blending capablilties // supported by the driver. // Note: The possible values these flags can have are basically // the same as those described for the SrcBlendCaps property of // this object. // -------------------------------------------------------------------------- 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 for this // 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. // // Setting of cull modes is accomplished through the // D3DRENDERSTATE_CULLMODE property of the D3DRENDERSTATETYPE // enumerated type ... // // This flag corresponds to the D3DCULL_CCW property of the // D3DCULL enumerated type. // // Software renderering uses a fixed culling order and thus // cannot change the culling mode. // // Culling is the removal of back face triangle primitives // that occupy the side of an object facing away from the // viewport so they are not needlessly rendered. // // The driver supports counterclockwise culling through the // D3DRENDERSTATE_CULLMODE state. (This applies only to // triangle primitives.) This corresponds to the D3DCULL_CCW // member of the D3DCULL enumerated type. // D3DPMISCCAPS_CULLCW - // Support for clockwise culling of triangle primitives is // available. // // Setting of cull modes is accomplished through the // D3DRENDERSTATE_CULLMODE property of the D3DRENDERSTATETYPE // enumerated type. ... // // This flag corresponds to the D3DCULL_CW property of the // D3DCULL enumerated type. // // Software renderering uses a fixed culling order and thus // cannot change the culling mode. // D3DPMISCCAPS_CULLNONE - // Support for culling is not available. // // Setting of cull modes is accomplished through the // D3DRENDERSTATE_CULLMODE proeprty of the D3DRENDERSTATETYPE // enumerated type // // This flag corresponds to the D3DCULL_NONE proeprty of the // D3DCULL enumerated type. // // Software renderering uses a fixed culling order and thus // cannot change the culling mode. // // D3DPMISCCAPS_LINEPATTERNREP - // Support for higher values than one in the RepeatFactor // property of the TD3DLinePattern object is available. // // This flag only applies only to line drawing primitives. // // D3DPMISCCAPS_MASKPLANES - // Support for color plane bitmasks is available. // D3DPMISCCAPS_MASKZ - // Pixel operations can be performed without modification of // the z-buffer. // -------------------------------------------------------------------------- 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. // D3DPRASTERCAPS_FOGTABLE - // Support for fog values that are calculated by referring to // a lookup table of fog values that are indexed to the depth // or z-coordinate of a given pixel 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 ) Specular property of // the TD3DTLVertex object. The fog value is then // interpolated during raturization. // D3DPRASTERCAPS_MIPMAPLODBIAS - // Support for Level Of Detail ( LOD ) mipmap bias adjustments // is available. // D3DPRASTERCAPS_PAT - // Support for patterned drawing is available for this // primitive. // // Patterned drawing is accomplished using // D3DRENDERSTATE_LINEPATTERN or one of the // D3DRENDERSTATE_STIPPLEPATTERN render states. // // 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 is available. // // This feature cannot be enabled and disabled, most devices // always support subpixel placement or never do. // // This flag is here to allow applications to better determine // rendering quality. // D3DPRASTERCAPS_SUBPIXELX - // Support for subpixel placement along the X axis only is // available. // // Subpixel correction takes place along the X axis and is // clamped to an integer Y axis scan line. // D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT - // Translucency support is not dependant on the sort order of // polygons. // D3DPRASTERCAPS_WBUFFER - // Depth buffering using the w-buffer is available in // hardware. // D3DPRASTERCAPS_WFOG - // Support for w-buffer based fog is available in hardware. // D3DPRASTERCAPS_XOR - // Support for XOR operations is available. // // When the D3DPRIM_RASTER_ROP2 flag of this property 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 wall with a shadow falling on it. Both the // wall and the shadow occupy the same depth, by giving the // shadow a higher Z bias than the wall will give the right // appearance without resorting to sorting the polygons. // 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_ZTEST - // Support for Z test operations is supported. // // This effectively renders a 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: These flags indicate the shading operations that the device // is capable of performing. // Note: The described effect applies when the flag is set. // The possible shade modes are contained in the D3DSHADEMODE // enumerated type. // 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. // In general, any commands the device supports are assumed to // also support the flat shading mode. // When alpha components are not supported in a given mode, the // alpha value is implicitly at maximum intensity (255) for that // mode. // // // ... from help file. // // Shading operations capabilities. It is assumed, in general, // that if a device supports a given command (such as // D3DOP_TRIANGLE) at all, it supports the D3DSHADE_FLAT mode // (as specified in the D3DSHADEMODE enumerated type). This flag // specifies whether the driver can also support Gouraud and // Phong shading and whether alpha color components are // supported for each of the three color-generation modes. When // alpha components are not supported in a given mode, the alpha // value of colors generated in that mode is implicitly 255. // This is the maximum possible alpha (that is, the alpha // component is at full intensity). Phong shading is not // currently supported. // With the monochromatic shading modes, the blue channel of the // specular component is interpreted as a white intensity. (This // is controlled by the D3DRENDERSTATE_MONOENABLE render state.) // // 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. For more information, see 3-D Primitives. // Flags: D3DPSHADECAPS_ALPHAFLATBLEND - // Support for an alpha component for blended transparency // when using the flat shade mode is available. // Note: The alpha component for the face is taken from the // first vertex. // D3DPSHADECAPS_ALPHAFLATSTIPPLED - // Support for an alpha component for stippled transparency // when using the flat shade mode is available. // Note: The alpha component for the face is taken from the // first vertex. // A stipple pattern is basically a block of line patterns // usually used to simulate transparency. // A line pattern is essentially a series of 1's and 0's that // are laid over a surface, pixels corresponding to the 1's // get drawn, 0's do not. // D3DPSHADECAPS_ALPHAGOURAUDBLEND - // Support for an alpha component for blended transparency // when using the gouraud shade mode is available. // Note: The alpha component is interpolated across the face // along with the other color components. // D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED - // Support for an alpha component for stippled transparency // when using the gouraud shade mode is available. // Note: The alpha component is interpolated across the face // along with the other color components. // A stipple pattern is basically a block of line patterns // usually used to simulate transparency. // A line pattern is essentially a series of 1's and 0's that // are laid over a surface, pixels corresponding to the 1's // get drawn, 0's do not. // D3DPSHADECAPS_ALPHAPHONGBLEND - // Support for an alpha component for blended transparency // when using the phong shade mode is available. // Note: The alpha component is reevaluated on a per pixel // basis along with the other color components. // D3DPSHADECAPS_ALPHAPHONGSTIPPLED - // Support for an alpha component for stippled transparency // when using the phong shade mode is available. // Note: The alpha component is reevaluated on a per pixel // basis along with the other color components. // A stipple pattern is basically a block of line patterns // usually used to simulate transparency. // A line pattern is essentially a series of 1's and 0's that // are laid over a surface, pixels corresponding to the 1's // get drawn, 0's do not. // D3DPSHADECAPS_COLORFLATMONO - // Support for monochrome flat shading is available. // Note: The color component for the face is taken from the // blue color of the first vertex. // D3DPSHADECAPS_COLORFLATRGB - // Support for colored flat shading is available. // Note: The color component for the face is taken from the // first vertex. // D3DPSHADECAPS_COLORGOURAUDMONO - // Support for monochrome gouraud shading is available. // Note: The blue color component is interpolated across the // face from the vertices. // D3DPSHADECAPS_COLORGOURAUDRGB - // Support for colored gouraud shading is available. ... // Note: The color component is interpolated across the face // from the vertices. // D3DPSHADECAPS_COLORPHONGMONO - // ... Support for monochrome phong shading is available. // Note: The blue color component is reevaluated on a per // pixel basis. // D3DPSHADECAPS_COLORPHONGRGB - // ... Support for colored phong shading is available. // Note: The color component is reevaluated on a per pixel // basis. // D3DPSHADECAPS_FOGFLAT - // ... Support for fog in the flat shading mode is available. // Note: Fog is basically a measure of visibility, lower // values equating to lower visibility. // D3DPSHADECAPS_FOGGOURAUD - // ... Support for fog in the gouraud shading mode is // available. // Note: Fog is basically a measure of visibility, lower // values equating to lower visibility. // D3DPSHADECAPS_FOGPHONG - // ... Support for fog in the phong shading mode is available. // Note: Fog is basically a measure of visibility, lower // values equating to lower visibility. // D3DPSHADECAPS_SPECULARFLATMONO - // ... Support for monochrome specular highlights in the flat // shade mode is available. // Note: Specular settings are used to determine the color of // a point of light on a shiny object that corresponds to a // reflected light source. // D3DPSHADECAPS_SPECULARFLATRGB - // ... Support for colored specular highlights in the flat // shade mode is available. // Note: Specular settings are used to determine the color of // a point of light on a shiny object that corresponds to a // reflected light source. // D3DPSHADECAPS_SPECULARGOURAUDMONO - // ... Support for monochrome specular highlights in the // gouraud shade mode is available. // Note: Specular settings are used to determine the color of // a point of light on a shiny object that corresponds to a // reflected light source. // D3DPSHADECAPS_SPECULARGOURAUDRGB - // ... Support for colored specular highlights in the gouraud // shade mode is available. // Note: Specular settings are used to determine the color of // a point of light on a shiny object that corresponds to a // reflected light source. // D3DPSHADECAPS_SPECULARPHONGMONO - // ... Support for monochrome specular highlights in the phong // shade mode is available. // Note: Specular settings are used to determine the color of // a point of light on a shiny object that corresponds to a // reflected light source. // D3DPSHADECAPS_SPECULARPHONGRGB - // ... Support for colored specular highlights in the phong // shade mode is available. // Note: Specular settings are used to determine the color of // a point of light on a shiny object that corresponds to a // reflected light source. // -------------------------------------------------------------------------- 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: These flags indicate the source blending capablilties. // // The described effect applies when the flag is set. // // Blend factor describes how each color component of a texture // is combined with those of the surface to which it is applied. // Flags: D3DPBLENDCAPS_BOTHINVSRCALPHA - // The source blend factor is (1-As, 1-As, 1-As, 1-As) and the // destination blend factor is (As, As, As, As). // Note: The destination blend selection is overridden by this // flag. // 1-As represents an inverted source alpha value, thus if it // was originally nearly opaque, it will now be nearly // transparent and vice versa. // As represents source alpha value. // D3DPBLENDCAPS_DESTALPHA - // The blend factor is (Ad, Ad, Ad, Ad). // Note: Ad represents destination alpha value. // D3DPBLENDCAPS_DESTCOLOR - // The blend factor is (Rd, Gd, Bd, Ad). // Note: Red, green, blue and alpha components of the // destination. // D3DPBLENDCAPS_INVDESTALPHA - // The blend factor is (1-Ad, 1-Ad, 1-Ad, 1-Ad). // Note: 1-Ad represents an inverted destination alpha value, // thus if it was originally nearly opaque, it will now be // nearly transparent and vice versa. // D3DPBLENDCAPS_INVDESTCOLOR - // The blend factor is (1-Rd, 1-Gd, 1-Bd, 1-Ad). // Note: Inverted red, green, blue and alpha components of the // destination. // D3DPBLENDCAPS_INVSRCALPHA - // The blend factor is (1-As, 1-As, 1-As, 1-As). // Note: 1-As represents an inverted source alpha value, thus // if it was originally nearly opaque, it will now be nearly // transparent and vice versa. // D3DPBLENDCAPS_INVSRCCOLOR - // The blend factor is (1-Rs, 1-Gs, 1-Bs, 1-As). // Note: Inverted red, green, blue and alpha components of the // source. // D3DPBLENDCAPS_ONE - // The blend factor is (1, 1, 1, 1). // D3DPBLENDCAPS_SRCALPHA - // The blend factor is (As, As, As, As). // Note: As represents the alpha component of the source. // D3DPBLENDCAPS_SRCALPHASAT - // The Blend factor is (f, f, f, 1) where f = min(As, 1-Ad). // D3DPBLENDCAPS_SRCCOLOR - // The blend factor is (Rs, Gs, Bs, As). // Note: Red, green, blue and alpha components of the source. // D3DPBLENDCAPS_ZERO - // The blend factor is (0, 0, 0, 0). // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetSrcBlendCaps() { return fD3DPRIMCAPS.dwSrcBlendCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetSrcBlendCaps( dword pSrcBlendCaps ) { fD3DPRIMCAPS.dwSrcBlendCaps = pSrcBlendCaps; } // -------------------------------------------------------------------------- // Property: StippleHeight // Description: Contains the maximum height of a stipple that the device // supports, up to a maximum value of 32. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetStippleHeight() { return fD3DPRIMCAPS.dwStippleHeight; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetStippleHeight( dword pStippleHeight ) { fD3DPRIMCAPS.dwStippleHeight = pStippleHeight; } // -------------------------------------------------------------------------- // Property: StippleWidth // Description: Contains the maximum width of a stipple that the device // supports, up to a maximum value of 32. // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetStippleWidth() { return fD3DPRIMCAPS.dwStippleWidth; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetStippleWidth( dword pStippleWidth ) { fD3DPRIMCAPS.dwStippleWidth = pStippleWidth; } // -------------------------------------------------------------------------- // Property: TextureAddressCaps // Description: These flags indicate what texture addressing capabilities the // device supports. // Note: 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 the clamping of textures to addresses is // available. // // Clamping a texture means that texture coordinates greater // than 1.0 are set to 1.0, and values less than 0.0 are set // to 0.0. // D3DPTADDRESSCAPS_INDEPENDENTUV - // Support for separate the texture addressing modes for the U // and V 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 // -------------------------------------------------------------------------- dword __fastcall TD3DPrimCaps::FGetTextureBlendCaps() { return fD3DPRIMCAPS.dwTextureBlendCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DPrimCaps::FSetTextureBlendCaps( dword pTextureBlendCaps ) { fD3DPRIMCAPS.dwTextureBlendCaps = pTextureBlendCaps; } // -------------------------------------------------------------------------- // Property: TextureCaps // Description: These flags indicate what miscellaneous texture mapping // capabilities are available. // Note: The described effect applies when the flag is set. // A texture is a small graphic, usually tiled or wrapped over a // 3D object or surface and referenced by the U and V // coordinates of a vertex. // A vertex represents a point in 3D space and consists of a // vector which defines position, a normal vector which defines // orientation, texture coordinates and a color. // Flags: D3DPTEXTURECAPS_ALPHA - // Support for RGBA textures when using decal and modulate // texture modes is available. // Note: Alpha is always supported in decal mask, decal alpha // and modulate alpha modes if they are available. // D3DPTEXTURECAPS_ALPHAPALETTE - // change this // Supports palettized texture surfaces whose palettes contain // alpha information (see DDPCAPS_ALPHA in the DDCAPS // structure). // D3DPTEXTURECAPS_BORDER - // Support for texture mapping along borders is available. // D3DPTEXTURECAPS_COLORKEYBLEND - // The D3DPTEXTURECAPS_COLORKEYBLEND property is used to... // The device supports alpha-blended colorkeying through the // use of the D3DRENDERSTATE_COLORKEYBLENDENABLE render state. // D3DPTEXTURECAPS_CUBEMAP - // The D3DPTEXTURECAPS_CUBEMAP property is used to...Supports // cubic environment mapping. This capability flag was // introduced with DirectX 7.0 // D3DPTEXTURECAPS_NONPOW2CONDITIONAL - // The D3DPTEXTURECAPS_NONPOW2CONDITIONAL property is used // to...Conditionally supports the use of textures with // dimensions that are not powers of 2. A device that exposes // this capability can use such a texture if all of the // following requirements are met. // The texture addressing mode for the texture stage is set to // D3DTADDRESS_CLAMP. // Texture wrapping for the texture stage is disabled // (D3DRENDERSTATE_WRAPn set to 0). // D3DPTEXTURECAPS_PERSPECTIVE - // Support for perspective correction is available. // Note: Perspective correction of textures involves // stretching the texture onto polygons that are angled away // from the camera in such a way as to maintain proper // perspective. // D3DPTEXTURECAPS_POW2 - // All textures used must have widths and heights that are // powers of two. // D3DPTEXTURECAPS_PROJECTED - // The D3DPTEXTURECAPS_PROJECTED property is used // to...Supports the D3DTTFF_PROJECTED texture transformation // flag. When applied, the device divides transformed texture // coordinates by the last texture coordinate // D3DPTEXTURECAPS_SQUAREONLY - // All textures used must be square. // D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE - // change this // Texture indices are not scaled by the texture size prior to // interpolation. // D3DPTEXTURECAPS_TRANSPARENCY - // Support for texture transparency is available. // Note: Texels 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: These flags indicate texture map filtering capabilities that // are available. // Note: The described effect applies when the flag is set. // A texture is a small graphic, usually tiled or wrapped over a // 3D object or surface and referenced by the U and V // coordinates of a vertex. // A vertex represents a point in 3D space and consists of a // vector which defines position, a normal vector which defines // orientation, texture coordinates and a color. // Flags: D3DPTFILTERCAPS_LINEAR - // Uses a weighted average of the 2 by 2 area of texels that // surround the desired pixel to determine the color that is // drawn. // Note: This applies to both zooming in and out. // D3DPTFILTERCAPS_LINEARMIPLINEAR - // Two mipmaps whose texels most closely match the size of the // pixel to be textured are interpolated to produce a final // texel value. // D3DPTFILTERCAPS_LINEARMIPNEAREST - // Chooses the mipmap whose texels most closely match the size // of the pixel to be textured and then uses the // D3DFILTER_LINEAR method. // D3DPTFILTERCAPS_MAGFAFLATCUBIC - // change this // The device supports per-stage flat-cubic filtering for // magnifying textures. The flat-cubic magnification filter is // represented by the D3DTFG_FLATCUBIC member of the // D3DTEXTUREMAGFILTER enumerated type. // D3DPTFILTERCAPS_MAGFANISOTROPIC - // change this // The device supports per-stage anisotropic filtering for // magnifying textures. The anisotropic magnification filter // is represented by the D3DTFG_ANISOTROPIC member of the // D3DTEXTUREMAGFILTER enumerated type. // D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC - // change this // The device supports the per-stage Gaussian-cubic filtering // for magnifying textures. The Gaussian-cubic magnification // filter is represented by the D3DTFG_GAUSSIANCUBIC member of // the D3DTEXTUREMAGFILTER enumerated type. // D3DPTFILTERCAPS_MAGFLINEAR - // change this // The device supports per-stage bilinear-interpolation // filtering for magnifying textures. The // bilinear-interpolation magnification filter is represented // by the D3DTFG_LINEAR member of the D3DTEXTUREMAGFILTER // enumerated type. // D3DPTFILTERCAPS_MAGFPOINT - // change this // The device supports per-stage point-sampled filtering for // magnifying textures. The point-sample magnification filter // is represented by the D3DTFG_POINT member of the // D3DTEXTUREMAGFILTER enumerated type. // D3DPTFILTERCAPS_MINFANISOTROPIC - // change this // The device supports per-stage anisotropic filtering for // minifying textures. The anisotropic minification filter is // represented by the D3DTFN_ANISOTROPIC member of the // D3DTEXTUREMINFILTER enumerated type. // D3DPTFILTERCAPS_MINFLINEAR - // change this // The device supports per-stage bilinear-interpolation // filtering for minifying textures. The bilinear minification // filter is represented by the D3DTFN_LINEAR member of the // D3DTEXTUREMINFILTER enumerated type. // D3DPTFILTERCAPS_MINFPOINT - // change this // The device supports per-stage point-sampled filtering for // minifying textures. The point-sample minification filter is // represented by the D3DTFN_POINT member of the // D3DTEXTUREMINFILTER enumerated type. // D3DPTFILTERCAPS_MIPFLINEAR - // change this // The device supports per-stage trilinear-interpolation // filtering for mipmaps. The trilinear-interpolation // mipmapping filter is represented by the D3DTFP_LINEAR // member of the D3DTEXTUREMIPFILTER enumerated type. // D3DPTFILTERCAPS_MIPFPOINT - // change this // The device supports per-stage point-sampled filtering for // mipmaps. The point-sample mipmapping filter is represented // by the D3DTFP_POINT member of the D3DTEXTUREMIPFILTER // enumerated type. // D3DPTFILTERCAPS_MIPLINEAR - // Two mipmaps are chosen whose texels most closely match the // size of the pixel to be textured. The D3DFILTER_NEAREST // method is then used with each texture to produce two values // which are then weighted to produce a final texel value. // D3DPTFILTERCAPS_MIPNEAREST - // Uses the mipmap and texel that has the closest coordinates // and texel size to the desired pixel value. // D3DPTFILTERCAPS_NEAREST - // Uses the texel with coordinates nearest to the desired // pixel value. // Note: This applies to both zooming in and out. // -------------------------------------------------------------------------- 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 - // A comparison that returns a pass for any z test is // available. // D3DPCMPCAPS_EQUAL - // A comparison that returns a pass when the z value being // tested is equal to the current z value is available. // D3DPCMPCAPS_GREATER - // A comparison that returns a pass when the z value being // tested is greater than the current z value is available. // D3DPCMPCAPS_GREATEREQUAL - // A comparison that returns a pass when the z value being // tested is greater than or equal to the current z value is // available. // D3DPCMPCAPS_LESS - // A comparison that returns a pass when the z value being // tested is less than the current z value is available. // D3DPCMPCAPS_LESSEQUAL - // A comparison that returns a pass when the z value being // tested is greater than or equal to the current z value is // available. // D3DPCMPCAPS_NEVER - // A comparison that returns a fail for any z test is // available. // D3DPCMPCAPS_NOTEQUAL - // A comparison that returns a pass when the z value being // tested is not equal to the current z value is available. // -------------------------------------------------------------------------- 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_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_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_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; } // --------------------------------------------------------------------------