// -------------------------------------------------------------------------- // ========================================================================== // File: TD3DCaps.CPP // Authors: BCB_Code_Generator v2.00, // Darren Dwyer (source code, documentation, demos, website), // Hugh Edwards (documentation, icons) // Description: This file contains the code for the TD3DCaps Component // // "TDx9_Graphics_Library v1.00" // (c) 2005 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 "TD3DCaps.H" // -------------------------------------------------------------------------- #pragma link "TDx_Library_Defns" #pragma link "TDx_Library_Functions" #pragma link "TDx9_Graphics_Library_Defns" #pragma link "TDx9_Graphics_Library_Functions" // -------------------------------------------------------------------------- // Object Registration... // -------------------------------------------------------------------------- #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ #pragma package(smart_init) #endif // -------------------------------------------------------------------------- static inline void ValidCtrCheck(TD3DCaps*) { new TD3DCaps(NULL); } // -------------------------------------------------------------------------- namespace Td3dcaps { #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ void __fastcall PACKAGE Register() #else void __fastcall Register() #endif { TComponentClass classes[1] = {__classid(TD3DCaps)}; RegisterComponents("TDx9_Graphics", classes, 0); } } // -------------------------------------------------------------------------- // Constructor: TD3DCaps::TD3DCaps() // Description: The default constructor for the TD3DCaps object. // -------------------------------------------------------------------------- __fastcall TD3DCaps::TD3DCaps(TComponent* Owner) : TComponent(Owner) { Clear(); fAlphaCmpCaps_Strings=NULL; fCaps_Strings=NULL; fCursorCaps_Strings=NULL; fDestBlendCaps_Strings=NULL; fDevCaps_Strings=NULL; fFVFCaps_Strings=NULL; fLineCaps_Strings=NULL; fPresentationIntervals_Strings=NULL; fRasterCaps_Strings=NULL; fShadeCaps_Strings=NULL; fSrcBlendCaps_Strings=NULL; fTextureAddressCaps_Strings=NULL; fTextureCaps_Strings=NULL; fTextureOpCaps_Strings=NULL; fVolumeTextureAddressCaps_Strings=NULL; fZCmpCaps_Strings=NULL; } // -------------------------------------------------------------------------- // Destructor: TD3DCaps::~TD3DCaps() // Description: The destructor for the TD3DCaps object. // -------------------------------------------------------------------------- __fastcall TD3DCaps::~TD3DCaps() { if (fAlphaCmpCaps_Strings!=NULL) delete fAlphaCmpCaps_Strings; if (fCaps_Strings!=NULL) delete fCaps_Strings; if (fCursorCaps_Strings!=NULL) delete fCursorCaps_Strings; if (fDestBlendCaps_Strings!=NULL) delete fDestBlendCaps_Strings; if (fDevCaps_Strings!=NULL) delete fDevCaps_Strings; if (fFVFCaps_Strings!=NULL) delete fFVFCaps_Strings; if (fLineCaps_Strings!=NULL) delete fLineCaps_Strings; if (fPresentationIntervals_Strings!=NULL) delete fPresentationIntervals_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 (fTextureOpCaps_Strings!=NULL) delete fTextureOpCaps_Strings; if (fVolumeTextureAddressCaps_Strings!=NULL) delete fVolumeTextureAddressCaps_Strings; if (fZCmpCaps_Strings!=NULL) delete fZCmpCaps_Strings; } // -------------------------------------------------------------------------- // Property: AdapterOrdinal // Description: The AdapterOrdinal property supplies the ordinal value of the // adapter on which the Direct3D device was created. // // The ordinal value will only have validity for the methods of // the TDx9_3D interface that created the device. // TDx9_3DDevice::GetDirect3D() can be used to retrieve the // correct TDx9_3D interface. // -------------------------------------------------------------------------- uint __fastcall TD3DCaps::FGetAdapterOrdinal() { return fD3DCAPS9.AdapterOrdinal; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetAdapterOrdinal( uint pAdapterOrdinal ) { fD3DCAPS9.AdapterOrdinal = pAdapterOrdinal; } // -------------------------------------------------------------------------- // Property: AdapterOrdinalInGroup // Description: The AdapterOrdinalInGroup property defines the reference // order of heads by the application programming interface // (API). // The master adapter is always 0. // These values are not the same as adapter ordinals, they only // apply to heads within a group. // -------------------------------------------------------------------------- uint __fastcall TD3DCaps::FGetAdapterOrdinalInGroup() { return fD3DCAPS9.AdapterOrdinalInGroup; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetAdapterOrdinalInGroup( uint pAdapterOrdinalInGroup ) { fD3DCAPS9.AdapterOrdinalInGroup = pAdapterOrdinalInGroup; } // -------------------------------------------------------------------------- // Property: AlphaCmpCaps // Description: The AlphaCmpCaps property defines which alpha comparison // capabilities are available. // The described effect applies when the flag is set. // When only D3DPCMPCAPS_ALWAYS or D3DPCMPCAPS_NEVER is set, // alpha tests are not supported. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetAlphaCmpCaps() { return fD3DCAPS9.AlphaCmpCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetAlphaCmpCaps( dword pAlphaCmpCaps ) { fD3DCAPS9.AlphaCmpCaps = pAlphaCmpCaps; } // -------------------------------------------------------------------------- // Property: Caps // Description: The Caps property defines the scanline capability of the // device. // The described effect applies when the flag is set. // Flags: D3DCAPS_READ_SCANLINE - // Support for returning the current scanline is present. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetCaps() { return fD3DCAPS9.Caps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetCaps( dword pCaps ) { fD3DCAPS9.Caps = pCaps; } // -------------------------------------------------------------------------- // Property: Caps2 // Description: The Caps2 property defines which driver specific capabilities // are available. // Possible values are defined by the D3DCAPS2 constant. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetCaps2() { return fD3DCAPS9.Caps2; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetCaps2( dword pCaps2 ) { fD3DCAPS9.Caps2 = pCaps2; } // -------------------------------------------------------------------------- // Property: Caps3 // Description: The Caps3 property defines more of the available driver // specific capabilities. // Possible values are defined by the D3DCAPS3 constant. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetCaps3() { return fD3DCAPS9.Caps3; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetCaps3( dword pCaps3 ) { fD3DCAPS9.Caps3 = pCaps3; } // -------------------------------------------------------------------------- // Property: CubeTextureFilterCaps // Description: The CubeTextureFilterCaps property defines the // texture-filtering capabilities of a cube texture. // Possible values are any combination of the per stage // filtering capabilties defined in the D3DPTFILTERCAPS // constant. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetCubeTextureFilterCaps() { return fD3DCAPS9.CubeTextureFilterCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetCubeTextureFilterCaps( dword pCubeTextureFilterCaps ) { fD3DCAPS9.CubeTextureFilterCaps = pCubeTextureFilterCaps; } // -------------------------------------------------------------------------- // Property: CursorCaps // Description: The CursorCaps property indicates the cursor support // available from hardware. // The described effect applies when the bit mask is set. // // DirectX 9 does not define alpa-blending cursor capabilities. // Flags: D3DCURSORCAPS_COLOR - // Support for full color cursors is available. // This means there is driver support for high resolution mode // hardware color cursors with scanlines >= 400. // D3DCURSORCAPS_LOWRES - // Support for full color cursors is available. // This means there is driver support for high resolution and // low resolution mode hardware color cursors with scanlines < // 400. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetCursorCaps() { return fD3DCAPS9.CursorCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetCursorCaps( dword pCursorCaps ) { fD3DCAPS9.CursorCaps = pCursorCaps; } // -------------------------------------------------------------------------- // Property: DeclTypes // Description: The DeclTypes property defines one or more data types // contained in a vertex declaration. // Possible values are defined by the D3DDTCAPS constant. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetDeclTypes() { return fD3DCAPS9.DeclTypes; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetDeclTypes( dword pDeclTypes ) { fD3DCAPS9.DeclTypes = pDeclTypes; } // -------------------------------------------------------------------------- // Property: DestBlendCaps // Description: The DestBlendCaps property defines which destination blending // capabilities are available. // The described effect applies when the flag is set. // Lowercase "s" and "d" indicate source and destination // respectively. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetDestBlendCaps() { return fD3DCAPS9.DestBlendCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetDestBlendCaps( dword pDestBlendCaps ) { fD3DCAPS9.DestBlendCaps = pDestBlendCaps; } // -------------------------------------------------------------------------- // Property: DevCaps // Description: The DevCaps property defines which device capabilities are // available. // The described effect applies when the flag is set. // Flags: D3DDEVCAPS_CANBLTSYSTONONLOCAL - // Support for texture blitting from system memory to // non-local video memory is available. // D3DDEVCAPS_CANRENDERAFTERFLIP - // Support for queuing rendering commands after a page flip is // available. // No changes to application behaviour are experienced but the // presence of this flag indicates the device is relatively // fast. // D3DDEVCAPS_DRAWPRIMITIVES2 - // Support for at least a DirectX 5.0 compliant driver is // available. // D3DDEVCAPS_DRAWPRIMITIVES2EX - // Support for at least a DirectX 7.0 compliant driver is // available. // D3DDEVCAPS_DRAWPRIMTLVERTEX - // Support for a TDx9_3DDevice::DrawPrimitive aware hardware // abstraction layer (HAL) is available. // D3DDEVCAPS_EXECUTESYSTEMMEMORY - // Support for system memory execute buffers is available. // D3DDEVCAPS_EXECUTEVIDEOMEMORY - // Support for video memory execute buffers is available. // D3DDEVCAPS_HWRASTERIZATION - // Support for hardware accelerated scene rasterization is // available. // D3DDEVCAPS_HWTRANSFORMANDLIGHT - // Support for hardware transformation and lighting is // available. // D3DDEVCAPS_NPATCHES - // Support for N patches is available. // D3DDEVCAPS_PUREDEVICE - // Support for hardware rasterization, transform, lighting and // shading is available. // D3DDEVCAPS_QUINTICRTPATCHES - // Support for quintic Bézier curves and B-splines is // available. // D3DDEVCAPS_RTPATCHES - // Support for rectangular and triangular patches is // available. // D3DDEVCAPS_RTPATCHHANDLEZERO - // Support for same efficiency drawing of non-cached patches // (handle zero) and cached patches is available. // Handle zero patches can always be drawn, but if this // capability is available, there will be no performance loss // from doing so. // D3DDEVCAPS_SEPARATETEXTUREMEMORIES - // Support for texturing from separate memory pools is // available. // D3DDEVCAPS_TEXTURENONLOCALVIDMEM - // Support for texture retrieval from non-local video memory // is available. // D3DDEVCAPS_TEXTURESYSTEMMEMORY - // Support for texture retrieval from system memory is // available. // D3DDEVCAPS_TEXTUREVIDEOMEMORY - // Support for texture retrieval from device memory is // available. // D3DDEVCAPS_TLVERTEXSYSTEMMEMORY - // Support for system memory buffering of transformed and lit // vertices is available. // D3DDEVCAPS_TLVERTEXVIDEOMEMORY - // Support for video memory buffering of transformed and lit // vertices is available. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetDevCaps() { return fD3DCAPS9.DevCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetDevCaps( dword pDevCaps ) { fD3DCAPS9.DevCaps = pDevCaps; } // -------------------------------------------------------------------------- // Property: DevCaps2 // Description: The DevCaps2 property defines which adaptive tessellation // capabilities are available. // Possible values are defined by the D3DDEVCAPS2 constant. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetDevCaps2() { return fD3DCAPS9.DevCaps2; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetDevCaps2( dword pDevCaps2 ) { fD3DCAPS9.DevCaps2 = pDevCaps2; } // -------------------------------------------------------------------------- // Property: DeviceType // Description: The DeviceType property identifies the resource type used for // processing vertices as delimited by the D3DDEVTYPE enumerated // type. // -------------------------------------------------------------------------- D3DDEVTYPE __fastcall TD3DCaps::FGetDeviceType() { return fD3DCAPS9.DeviceType; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetDeviceType( D3DDEVTYPE pDeviceType ) { fD3DCAPS9.DeviceType = pDeviceType; } // -------------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TD3DCaps method or fget/fset. eg. // D3D_OK or DDERR_SURFACELOST or TDX_ERROR // -------------------------------------------------------------------------- HRESULT __fastcall TD3DCaps::FGetErrorValue() { return fErrorValue; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetErrorValue( HRESULT pErrorValue ) { fErrorValue = pErrorValue; } // -------------------------------------------------------------------------- // Property: ExtentsAdjust // Description: The ExtentsAdjust property indicates how many pixels the // extents rectangle should be adjusted outward to accommodate // antialiasing kernels. // -------------------------------------------------------------------------- float __fastcall TD3DCaps::FGetExtentsAdjust() { return fD3DCAPS9.ExtentsAdjust; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetExtentsAdjust( float pExtentsAdjust ) { fD3DCAPS9.ExtentsAdjust = pExtentsAdjust; } // -------------------------------------------------------------------------- // Property: FVFCaps // Description: The FVFCaps property defines which flexible vertex format // capabilities are available. // The described effect applies when the flag is set. // Flags: D3DFVFCAPS_DONOTSTRIPELEMENTS - // Vertex elements should not be stripped. // ie: if there are vertex format elements not used by the // current render states, there is no need to regenerate the // vertices. // When not set, stripping extraneous elements improves // performance. // D3DFVFCAPS_PSIZE - // For flexible vertex formats, point size can come from the // vertex declaration, otherwise it is defined by the // D3DRS_POINTSIZE member of the D3DRENDERSTATETYPE enumerated // type. // If point size is available from both sources, the vertex // declaration is used. // D3DFVFCAPS_TEXCOORDCOUNTMASK - // Casting the low WORD of FVFCaps to the WORD data type will // define the maximum simultaneous texture coordinate sets the // device can use for multiple texture blending. // Up to 8 texture coordinate sets can be used for any vertex, // but the device can blend only the specified number. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetFVFCaps() { return fD3DCAPS9.FVFCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetFVFCaps( dword pFVFCaps ) { fD3DCAPS9.FVFCaps = pFVFCaps; } // -------------------------------------------------------------------------- // Property: GuardBandBottom // Description: The GuardBandBottom property defines the bottom screen space // coordinate of the guard band clipping region. // Coordinates within the guard band clipping region but outside // the viewport rectangle are automatically clipped. // -------------------------------------------------------------------------- float __fastcall TD3DCaps::FGetGuardBandBottom() { return fD3DCAPS9.GuardBandBottom; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetGuardBandBottom( float pGuardBandBottom ) { fD3DCAPS9.GuardBandBottom = pGuardBandBottom; } // -------------------------------------------------------------------------- // Property: GuardBandLeft // Description: The GuardBandLeft property defines the left screen space // coordinate of the guardband clipping region. // Coordinates within the guard band clipping region but outside // the viewport rectangle are automatically clipped. // -------------------------------------------------------------------------- float __fastcall TD3DCaps::FGetGuardBandLeft() { return fD3DCAPS9.GuardBandLeft; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetGuardBandLeft( float pGuardBandLeft ) { fD3DCAPS9.GuardBandLeft = pGuardBandLeft; } // -------------------------------------------------------------------------- // Property: GuardBandRight // Description: The GuardBandRight property defines the right screen space // coordinate of the guard band clipping region. // Coordinates within the guard band clipping region but outside // the viewport rectangle are automatically clipped. // -------------------------------------------------------------------------- float __fastcall TD3DCaps::FGetGuardBandRight() { return fD3DCAPS9.GuardBandRight; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetGuardBandRight( float pGuardBandRight ) { fD3DCAPS9.GuardBandRight = pGuardBandRight; } // -------------------------------------------------------------------------- // Property: GuardBandTop // Description: The GuardBandTop property defines the top screen space // coordinate of the guard band clipping region. // Coordinates within the guard band clipping region but outside // the viewport rectangle are automatically clipped. // -------------------------------------------------------------------------- float __fastcall TD3DCaps::FGetGuardBandTop() { return fD3DCAPS9.GuardBandTop; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetGuardBandTop( float pGuardBandTop ) { fD3DCAPS9.GuardBandTop = pGuardBandTop; } // -------------------------------------------------------------------------- // Property: LineCaps // Description: The LineCaps property defines which line drawing primitive // capabilities are available. // The described effect applies when the flag is set. // Flags: D3DLINECAPS_ALPHACMP - // Support for alpha test comparisons is available. // D3DLINECAPS_ANTIALIAS - // Support for anti aliased lines is available. // D3DLINECAPS_BLEND - // Support for source blending is available. // D3DLINECAPS_FOG - // Support for fog is available. // D3DLINECAPS_TEXTURE - // Support for texture mapping is available. // D3DLINECAPS_ZTEST - // Support for z buffer comparisons is available. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetLineCaps() { return fD3DCAPS9.LineCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetLineCaps( dword pLineCaps ) { fD3DCAPS9.LineCaps = pLineCaps; } // -------------------------------------------------------------------------- // Property: MasterAdapterOrdinal // Description: The MasterAdapterOrdinal property defines which device is the // master for this subordinate. // In multihead support, one head is designated master and all // other heads on the same card are designated subordinate. // When multiple multihead adapters are present, each // master/subordinate set is called a group. // -------------------------------------------------------------------------- uint __fastcall TD3DCaps::FGetMasterAdapterOrdinal() { return fD3DCAPS9.MasterAdapterOrdinal; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMasterAdapterOrdinal( uint pMasterAdapterOrdinal ) { fD3DCAPS9.MasterAdapterOrdinal = pMasterAdapterOrdinal; } // -------------------------------------------------------------------------- // Property: MaxActiveLights // Description: The MaxActiveLights property defines how many simultaneous // lights the device can support. // This value for the same physical device may vary depending on // the parameters of the TDx9_3D::CreateDevice() call that // created the TDx9_3DDevice. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxActiveLights() { return fD3DCAPS9.MaxActiveLights; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxActiveLights( dword pMaxActiveLights ) { fD3DCAPS9.MaxActiveLights = pMaxActiveLights; } // -------------------------------------------------------------------------- // Property: MaxAnisotropy // Description: The MaxAnisotropy property defines the maximum valid value of // the D3DSAMPLERSTATE enumerated types D3DSAMP_MAXANISOTROPY // texture-stage state. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxAnisotropy() { return fD3DCAPS9.MaxAnisotropy; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxAnisotropy( dword pMaxAnisotropy ) { fD3DCAPS9.MaxAnisotropy = pMaxAnisotropy; } // -------------------------------------------------------------------------- // Property: MaxNpatchTessellationLevel // Description: The MaxNpatchTessellationLevel property defines the maximum // number of n patch subdivision levels. // When using presampled displacement mapping, applications will // be clamped to this value. // -------------------------------------------------------------------------- float __fastcall TD3DCaps::FGetMaxNpatchTessellationLevel() { return fD3DCAPS9.MaxNpatchTessellationLevel; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxNpatchTessellationLevel( float pMaxNpatchTessellationLevel ) { fD3DCAPS9.MaxNpatchTessellationLevel = pMaxNpatchTessellationLevel; } // -------------------------------------------------------------------------- // Property: MaxPShaderInstructionsExecuted // Description: The MaxPShaderInstructionsExecuted property defines how many // pixel shader instructions can be run. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxPShaderInstructionsExecuted() { return fD3DCAPS9.MaxPShaderInstructionsExecuted; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxPShaderInstructionsExecuted( dword pMaxPShaderInstructionsExecuted ) { fD3DCAPS9.MaxPShaderInstructionsExecuted = pMaxPShaderInstructionsExecuted; } // -------------------------------------------------------------------------- // Property: MaxPixelShader30InstructionSlots // Description: The MaxPixelShader30InstructionSlots defines how many pixel // shader instruction slots are supported. // The maximum value is 32768 and vs_3_0 devices are required to // support at least 512. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxPixelShader30InstructionSlots() { return fD3DCAPS9.MaxPixelShader30InstructionSlots; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxPixelShader30InstructionSlots( dword pMaxPixelShader30InstructionSlots ) { fD3DCAPS9.MaxPixelShader30InstructionSlots = pMaxPixelShader30InstructionSlots; } // -------------------------------------------------------------------------- // Property: MaxPointSize // Description: The MaxPointSize property defines the largest a point // primitive can be. // When set to 1.0f point size control is not supported. The // range is greater than or equal to 1.0f. // -------------------------------------------------------------------------- float __fastcall TD3DCaps::FGetMaxPointSize() { return fD3DCAPS9.MaxPointSize; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxPointSize( float pMaxPointSize ) { fD3DCAPS9.MaxPointSize = pMaxPointSize; } // -------------------------------------------------------------------------- // Property: MaxPrimitiveCount // Description: The MaxPrimitiveCount property defines how many primitives // each TDx9_3DDevice::DrawPrimitive() call can cope with. // When not 0xffff, MaxPrimitiveCount primitives can be used // with each draw call. // When it is 0xffff, then the primitive limit still applies but // you are also limited to MaxPrimitiveCount unique vertices. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxPrimitiveCount() { return fD3DCAPS9.MaxPrimitiveCount; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxPrimitiveCount( dword pMaxPrimitiveCount ) { fD3DCAPS9.MaxPrimitiveCount = pMaxPrimitiveCount; } // -------------------------------------------------------------------------- // Property: MaxSimultaneousTextures // Description: The MaxSimultaneousTextures property defines how many // simultaneous textures can be bound to fixed function pipeline // sampler stages using TDx9_3DDevice::SetTexture. // A texture bound to multiple sampler stages counts as multiple // textures. // This property is irrelevent for programmable pipelines. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxSimultaneousTextures() { return fD3DCAPS9.MaxSimultaneousTextures; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxSimultaneousTextures( dword pMaxSimultaneousTextures ) { fD3DCAPS9.MaxSimultaneousTextures = pMaxSimultaneousTextures; } // -------------------------------------------------------------------------- // Property: MaxStreamStride // Description: The MaxStreamStride property defines the largest stride // TDx9_3DDevice::SetStreamSource() can use. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxStreamStride() { return fD3DCAPS9.MaxStreamStride; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxStreamStride( dword pMaxStreamStride ) { fD3DCAPS9.MaxStreamStride = pMaxStreamStride; } // -------------------------------------------------------------------------- // Property: MaxStreams // Description: The MaxStreams property defines how many concurrent data // streams TDx9_3DDevice::SetStreamSource() can handle. // Valid values range from 1 to 16 and a value of 0 indicates a // non DirectX 9 driver. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxStreams() { return fD3DCAPS9.MaxStreams; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxStreams( dword pMaxStreams ) { fD3DCAPS9.MaxStreams = pMaxStreams; } // -------------------------------------------------------------------------- // Property: MaxTextureAspectRatio // Description: The MaxTextureAspectRatio property defines the maximum // texture aspect ratio the hardware supports and is usually a // power of 2. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxTextureAspectRatio() { return fD3DCAPS9.MaxTextureAspectRatio; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxTextureAspectRatio( dword pMaxTextureAspectRatio ) { fD3DCAPS9.MaxTextureAspectRatio = pMaxTextureAspectRatio; } // -------------------------------------------------------------------------- // Property: MaxTextureBlendStages // Description: The MaxTextureBlendStages property defines the number of // texture blending stages available for a fixed function // pipeline. // For a programmable pixel pipeline, this value corresponds // with the number of unique texture registers used by pixel // shader instructions. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxTextureBlendStages() { return fD3DCAPS9.MaxTextureBlendStages; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxTextureBlendStages( dword pMaxTextureBlendStages ) { fD3DCAPS9.MaxTextureBlendStages = pMaxTextureBlendStages; } // -------------------------------------------------------------------------- // Property: MaxTextureHeight // Description: The MaxTextureHeight property defines the maximum texture // height the device can support. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxTextureHeight() { return fD3DCAPS9.MaxTextureHeight; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxTextureHeight( dword pMaxTextureHeight ) { fD3DCAPS9.MaxTextureHeight = pMaxTextureHeight; } // -------------------------------------------------------------------------- // Property: MaxTextureRepeat // Description: The MaxTextureRepeat property defines the maximum range of // the integer bits of post-normalised texture coordinates. // // Texture coordinates are stored as a 32 bit signed integer. 27 // bits are used to store the integer part and 5 bits for the // floating point fraction. // The maximum integer index of 227 is used to calculate the // maximum texture coordinate, which varies according to how the // hardware performs texture coordinate scaling. // // Some hardware reports the cap TextureCaps, in which case // texture coordinate scaling by the texture size is deferred // until after interpolation and application of the texture // address mode. This means that the value of this property now // stores the number of times a texture can be wrapped. // // A worse case is when TextureCaps is not set and the device // scales the texture coordinates by the texture size prior to // interpolation. This means the number of times a texture can // be wrapped is limited to the value of this property divided // by the texture size. // // Example: MaxTextureRepeat is 32k, texture size is 4k. If // TextureCaps is set, a texture can be wrapped 32k times. If // TextureCaps is not set, the limit is only 8 (32k divided by // 4k). // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxTextureRepeat() { return fD3DCAPS9.MaxTextureRepeat; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxTextureRepeat( dword pMaxTextureRepeat ) { fD3DCAPS9.MaxTextureRepeat = pMaxTextureRepeat; } // -------------------------------------------------------------------------- // Property: MaxTextureWidth // Description: The MaxTextureWidth property defines the maximum texture // width the device can support. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxTextureWidth() { return fD3DCAPS9.MaxTextureWidth; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxTextureWidth( dword pMaxTextureWidth ) { fD3DCAPS9.MaxTextureWidth = pMaxTextureWidth; } // -------------------------------------------------------------------------- // Property: MaxUserClipPlanes // Description: The MaxUserClipPlanes property defines how many user defined // clipping planes the device can support. // This value can be 0 and may vary for the same physical device // depending on the parameters of the TDx9_3D::CreateDevice() // call that created the TDx9_3DDevice. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxUserClipPlanes() { return fD3DCAPS9.MaxUserClipPlanes; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxUserClipPlanes( dword pMaxUserClipPlanes ) { fD3DCAPS9.MaxUserClipPlanes = pMaxUserClipPlanes; } // -------------------------------------------------------------------------- // Property: MaxVShaderInstructionsExecuted // Description: The MaxVShaderInstructionsExecuted property defines how many // vertex shader instructions can be run. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxVShaderInstructionsExecuted() { return fD3DCAPS9.MaxVShaderInstructionsExecuted; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxVShaderInstructionsExecuted( dword pMaxVShaderInstructionsExecuted ) { fD3DCAPS9.MaxVShaderInstructionsExecuted = pMaxVShaderInstructionsExecuted; } // -------------------------------------------------------------------------- // Property: MaxVertexBlendMatrices // Description: The MaxVertexBlendMatrices property defines how many matrices // the device can apply when multimatrix vertex blending. // This value for the same physical device may vary depending on // the parameters of the TDx9_3D::CreateDevice() call that // created the TDx9_3DDevice. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxVertexBlendMatrices() { return fD3DCAPS9.MaxVertexBlendMatrices; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxVertexBlendMatrices( dword pMaxVertexBlendMatrices ) { fD3DCAPS9.MaxVertexBlendMatrices = pMaxVertexBlendMatrices; } // -------------------------------------------------------------------------- // Property: MaxVertexBlendMatrixIndex // Description: The MaxVertexBlendMatrixIndex property defines the largest // matrix index indexable using the per vertex indices. // MaxVertexBlendMatrixIndex + 1 is the number of matrices and // the size of the matrix palette. When normals are present in // vertices that need to be lighting blended, then the number of // matrices is half this value. // When 0, indexed vertex blending and indexed matrices are not // supported, otherwise there is a valid range of 0 to the value // of this property. // Software vertex processing can handle 256 matrices whether or // not normals need to be blended. // This value for the same physical device may vary depending on // the parameters of the TDx9_3D::CreateDevice() call that // created the TDx9_3DDevice. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxVertexBlendMatrixIndex() { return fD3DCAPS9.MaxVertexBlendMatrixIndex; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxVertexBlendMatrixIndex( dword pMaxVertexBlendMatrixIndex ) { fD3DCAPS9.MaxVertexBlendMatrixIndex = pMaxVertexBlendMatrixIndex; } // -------------------------------------------------------------------------- // Property: MaxVertexIndex // Description: The MaxVertexIndex property defines the largest indices that // can be used for hardware vertex processing. // While it is possible to create 32 bit index buffers, unless // this property is greater than 0x0000FFFF then you will not be // able to render with them. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxVertexIndex() { return fD3DCAPS9.MaxVertexIndex; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxVertexIndex( dword pMaxVertexIndex ) { fD3DCAPS9.MaxVertexIndex = pMaxVertexIndex; } // -------------------------------------------------------------------------- // Property: MaxVertexShader30InstructionSlots // Description: The MaxVertexShader30InstructionSlots defines how many vertex // shader instruction slots are supported. // The maximum value is 32768 and vs_3_0 devices are required to // support at least 512. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxVertexShader30InstructionSlots() { return fD3DCAPS9.MaxVertexShader30InstructionSlots; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxVertexShader30InstructionSlots( dword pMaxVertexShader30InstructionSlots ) { fD3DCAPS9.MaxVertexShader30InstructionSlots = pMaxVertexShader30InstructionSlots; } // -------------------------------------------------------------------------- // Property: MaxVertexShaderConst // Description: The MaxVertexShaderConst property defines how many vertex // shader registers have been reserved for constants. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxVertexShaderConst() { return fD3DCAPS9.MaxVertexShaderConst; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxVertexShaderConst( dword pMaxVertexShaderConst ) { fD3DCAPS9.MaxVertexShaderConst = pMaxVertexShaderConst; } // -------------------------------------------------------------------------- // Property: MaxVertexW // Description: The MaxVertexW property defines the maximum supported w-based // depth value. // -------------------------------------------------------------------------- float __fastcall TD3DCaps::FGetMaxVertexW() { return fD3DCAPS9.MaxVertexW; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxVertexW( float pMaxVertexW ) { fD3DCAPS9.MaxVertexW = pMaxVertexW; } // -------------------------------------------------------------------------- // Property: MaxVolumeExtent // Description: The MaxVolumeExtent property defines the maximum value for // any of the three volume texture dimensions the device can // support. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetMaxVolumeExtent() { return fD3DCAPS9.MaxVolumeExtent; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetMaxVolumeExtent( dword pMaxVolumeExtent ) { fD3DCAPS9.MaxVolumeExtent = pMaxVolumeExtent; } // -------------------------------------------------------------------------- // Property: NumSimultaneousRTs // Description: The NumSimultaneousRTs property indicates how many // simultaneous render targets are allowed. // This value must be at least 1. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetNumSimultaneousRTs() { return fD3DCAPS9.NumSimultaneousRTs; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetNumSimultaneousRTs( dword pNumSimultaneousRTs ) { fD3DCAPS9.NumSimultaneousRTs = pNumSimultaneousRTs; } // -------------------------------------------------------------------------- // Property: NumberOfAdaptersInGroup // Description: The NumberOfAdaptersInGroup property will define how many // adapters there are in this group, but only if this adapter is // master. // Usually this will be 1. If its greater than 1 then this // adapter is the master. If the value is 0 then the adapter is // subordinate. // A single card can have only one master, but may have multiple // subordinates. // -------------------------------------------------------------------------- uint __fastcall TD3DCaps::FGetNumberOfAdaptersInGroup() { return fD3DCAPS9.NumberOfAdaptersInGroup; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetNumberOfAdaptersInGroup( uint pNumberOfAdaptersInGroup ) { fD3DCAPS9.NumberOfAdaptersInGroup = pNumberOfAdaptersInGroup; } // -------------------------------------------------------------------------- // Property: PS20Caps // Description: The PS20Caps property holds a TD3DPShaderCaps component // indicating what support for pixel shader version 2_0 extended // capability is available. // -------------------------------------------------------------------------- D3DPSHADERCAPS2_0 __fastcall TD3DCaps::FGetPS20Caps() { return fD3DCAPS9.PS20Caps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetPS20Caps( D3DPSHADERCAPS2_0 pPS20Caps ) { fD3DCAPS9.PS20Caps = pPS20Caps; } // -------------------------------------------------------------------------- // Property: PixelShader1xMaxValue // Description: The PixelShader1xMaxValue property defines the maximum value // of the pixel shader arithmetic component. // Usually an absolute value, so for example, if this property // is 8.0, then the range is from -8.0 to 8.0 // An absolute value < 1.0 indicates the hardware does not // support pixel shading. // -------------------------------------------------------------------------- float __fastcall TD3DCaps::FGetPixelShader1xMaxValue() { return fD3DCAPS9.PixelShader1xMaxValue; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetPixelShader1xMaxValue( float pPixelShader1xMaxValue ) { fD3DCAPS9.PixelShader1xMaxValue = pPixelShader1xMaxValue; } // -------------------------------------------------------------------------- // Property: PixelShaderVersion // Description: The PixelShaderVersion defines two numbers representing the // pixel shader main and sub version. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetPixelShaderVersion() { return fD3DCAPS9.PixelShaderVersion; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetPixelShaderVersion( dword pPixelShaderVersion ) { fD3DCAPS9.PixelShaderVersion = pPixelShaderVersion; } // -------------------------------------------------------------------------- // Property: PresentationIntervals // Description: The PresentationIntervals property identifies what // presentation swap intervals are available. // The described effect applies when the bitmask is set. // Flags: D3DPRESENT_INTERVAL_FOUR - // Support for a presentation swap interval every four screen // refreshes is available. // D3DPRESENT_INTERVAL_IMMEDIATE - // Support for an immediate presentation swap interval is // available. // D3DPRESENT_INTERVAL_ONE - // Support for a presentation swap interval every screen // refresh is available. // D3DPRESENT_INTERVAL_THREE - // Support for a presentation swap interval every third screen // refresh is available. // D3DPRESENT_INTERVAL_TWO - // Support for a presentation swap interval every second // screen refresh is available. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetPresentationIntervals() { return fD3DCAPS9.PresentationIntervals; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetPresentationIntervals( dword pPresentationIntervals ) { fD3DCAPS9.PresentationIntervals = pPresentationIntervals; } // -------------------------------------------------------------------------- // Property: PrimitiveMiscCaps // Description: The PrimitiveMiscCaps property defines which driver primitive // capabilities are available. // Possible values are defined by the D3DPMISCCAPS constant. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetPrimitiveMiscCaps() { return fD3DCAPS9.PrimitiveMiscCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetPrimitiveMiscCaps( dword pPrimitiveMiscCaps ) { fD3DCAPS9.PrimitiveMiscCaps = pPrimitiveMiscCaps; } // -------------------------------------------------------------------------- // Property: RasterCaps // Description: The RasterCaps property defines which raster-drawing // capabilities are available // The described effect applies when the flag is set. // Flags: D3DPRASTERCAPS_ANISOTROPY - // Support for anisotropic filtering is available. // D3DPRASTERCAPS_COLORPERSPECTIVE - // Support for correct color perspective iteration is // available. // D3DPRASTERCAPS_DEPTHBIAS - // Support for legacy depth bias is available. // D3DPRASTERCAPS_DITHER - // Support for dithering to improve color resolution is // available. // D3DPRASTERCAPS_FOGRANGE - // Support for range based fog is available. // Range based fog computes fog effects using the viewer to // object distance as opposed to the objects scene depth (z // coordinate). // D3DPRASTERCAPS_FOGTABLE - // Support for calculating fog values from a lookup table // indexed to the depth of a given pixel is available. // D3DPRASTERCAPS_FOGVERTEX - // Support for calculating fog values during the lighting // operation then interpolating the fog during rasterization // is available. // D3DPRASTERCAPS_MIPMAPLODBIAS - // Support for level of detail (LOD) bias adjustments is // available. // Bias adjustments can be used to make a mipmap appear // crisper or less sharp than normal. // The D3DSAMP_MIPMAPLODBIAS member of the D3DSAMPLERSTATETYPE // enumerated type defines the LOD Bias. // D3DPRASTERCAPS_MULTISAMPLE_TOGGLE - // Support for switching multisampling on and off between // calls to TDx9_3DDevice::BeginScene() and // TDx9_3DDevice::EndScene() is available. // The D3DRS_MULTISAMPLEANTIALIAS member of the // D3DRENDERSTATETYPE enumerated type defines whether // multisampling is being used or not. // D3DPRASTERCAPS_SCISSORTEST - // Support for scissor tests is available. // D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS - // Support for true slope-scale based depth bias is available. // D3DPRASTERCAPS_WBUFFER - // Support for w depth buffering is available. // D3DPRASTERCAPS_WFOG - // Support for w based fog is available. // W-based fog is used when a perspective projection matrix is // specified, but affine projections still use z-based fog. // A projection matrix with a nonzero [3][4] element is // considered a perspective projection matrix. // D3DPRASTERCAPS_ZBUFFERLESSHSR - // Support for hidden surface removal without polygon or depth // buffer allocation is available. // This hidden surface removal is hardware dependent and // transparent to the application and happens when the // D3DRS_ZENABLE member of the D3DRENDERSTATETYPE enumerate // type is set to true but there is no depth buffer associated // with the rendering target. // D3DPRASTERCAPS_ZFOG - // Support for z-based fog is available. // D3DPRASTERCAPS_ZTEST - // Support for z-test operations is available. // A z-test effectively renders a primitive then indicates // whether z pixels were rendered. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetRasterCaps() { return fD3DCAPS9.RasterCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetRasterCaps( dword pRasterCaps ) { fD3DCAPS9.RasterCaps = pRasterCaps; } // -------------------------------------------------------------------------- // Property: ShadeCaps // Description: The ShadeCaps property defines the shading capabilities that // are available. // The described effect applies when the flag is set. // If shading is supported at all, the D3DSHADE_FLAT option of // the D3DSHADEMODE enumerated type can be assumed to be // supported. // When alpha components are unsupported the generated alpha // value is implicitly 255. // Flags: D3DPSHADECAPS_ALPHAGOURAUDBLEND - // Support for Gouraud blended alpha transparency is // available. // Alpha components are set at vertices and interpolated // across a face along with the other colors. // D3DPSHADECAPS_COLORGOURAUDRGB - // Support for color Gouraud shading is available. // RGB colors are set at vertices and interpolated across a // face. // D3DPSHADECAPS_FOGGOURAUD - // Support for fog when Gouraud shading is available. // D3DPSHADECAPS_SPECULARGOURAUDRGB - // Support for specular highlights when Gouraud shading is // available. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetShadeCaps() { return fD3DCAPS9.ShadeCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetShadeCaps( dword pShadeCaps ) { fD3DCAPS9.ShadeCaps = pShadeCaps; } // -------------------------------------------------------------------------- // Property: Size // Description: The Size property contains the size in bytes of the internal // _D3DCAPS9 structure. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetSize() { return fSize; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetSize( dword pSize ) { fSize = pSize; } // -------------------------------------------------------------------------- // Property: SrcBlendCaps // Description: The SrcBlendCaps property defines which source blending // capabilities are available. // The described effect applies when the flag is set. // Lowercase "s" and "d" indicate source and destination // respectively. // Flags: D3DPBLENDCAPS_BLENDFACTOR - // Support for both the D3DBLEND_BLENDFACTOR and // D3DBLEND_INVBLENDFACTOR options of the D3DBLEND enumerated // type is available. // D3DPBLENDCAPS_BOTHINVSRCALPHA - // Support for using an inverted source blend factor for the // source alpha value and the source blend factor for the // destination alpha value is available. // ie: Source is (1-As, 1-As, 1-As, 1-As) and destination is // (As, As, As, As), with the destination blend selection // being overridden. // D3DPBLENDCAPS_BOTHSRCALPHA - // Support for the D3DBLEND_BOTHSRCALPHA option of the // D3DBLEND enumerated type. // This option is obsolete, set the D3DBLEND_SRCALPHA and // D3DBLEND_INVSRCALPHA members of D3DBLEND in separate calls // to achieve exactly the same effect. // D3DPBLENDCAPS_DESTALPHA - // Support for using the destination blend factor for the // alpha value is available. // ie: The blend factor is (Ad, Ad, Ad, Ad). // D3DPBLENDCAPS_DESTCOLOR - // Support for using the destination blend factor for the // color value is available. // ie: The blend factor is (Rd, Gd, Bd, Ad). // D3DPBLENDCAPS_INVDESTALPHA - // Support for using the inverted destination blend factor for // the alpha value is available. // ie: The blend factor is (1-Ad, 1-Ad, 1-Ad, 1-Ad). // D3DPBLENDCAPS_INVDESTCOLOR - // Support for using the inverted destination blend factor for // the color value is available. // ie: The blend factor is (1-Rd, 1-Gd, 1-Bd, 1-Ad). // D3DPBLENDCAPS_INVSRCALPHA - // Support for using the inverted source blend factor for the // alpha value is available. // ie: The blend factor is (1-As, 1-As, 1-As, 1-As). // D3DPBLENDCAPS_INVSRCCOLOR - // Support for using the inverted source blend factor for the // color value is available. // ie: The blend factor is (1-Rs, 1-Gs, 1-Bs, 1-As). // D3DPBLENDCAPS_ONE - // Support for using 1 as the blend factor is available. // ie: The blend factor is [1, 1, 1, 1] // D3DPBLENDCAPS_SRCALPHA - // Support for using the source blend factor for the alpha // value is available. // ie: The blend factor is (As, As, As, As). // D3DPBLENDCAPS_SRCALPHASAT - // Support for using the lower of alpha value of the source or // inverse destination is available. // ie: The blend factor is (f, f, f, 1) where f = min(As, // 1-Ad). // D3DPBLENDCAPS_SRCCOLOR - // Support for using the source blend factor for the color // value is available. // ie: The blend factor is (Rs, Gs, Bs, As). // D3DPBLENDCAPS_ZERO - // Support for using 0 as the blend factor is available. // ie: The blend factor is [0, 0, 0, 0] // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetSrcBlendCaps() { return fD3DCAPS9.SrcBlendCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetSrcBlendCaps( dword pSrcBlendCaps ) { fD3DCAPS9.SrcBlendCaps = pSrcBlendCaps; } // -------------------------------------------------------------------------- // Property: StencilCaps // Description: The StencilCaps property define which stencil buffer // operations are supported. // Possible values are defined by the D3DSTENCILCAPS constant. // Stencil operations are assumed valid for all the // D3DRS_STENCILFAIL, D3DRS_STENCILPASS and D3DRS_STENCILZFAIL // render states in the D3DRENDERSTATETYPE enumerated type. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetStencilCaps() { return fD3DCAPS9.StencilCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetStencilCaps( dword pStencilCaps ) { fD3DCAPS9.StencilCaps = pStencilCaps; } // -------------------------------------------------------------------------- // Property: StretchRectFilterCaps // Description: The StretchRectFilterCaps property indicates which // TDx9_3DDevice::StretchRect() operations are available. // The possible values are: // D3DPTFILTERCAPS_MINFPOINT : Support for point sample // filtering for minifying rectangles is available. Set // D3DTEXF_POINT when calling TDx9_3DDevice::StretchRect() to // utilize this filter. // D3DPTFILTERCAPS_MAGFPOINT : Support for point sample // filtering for magnifying rectangles is available. Set // D3DTEXF_POINT when calling TDx9_3DDevice::StretchRect() to // utilize this filter. // D3DPTFILTERCAPS_MINFLINEAR : Support for bilinear // interpolation filtering for minifying rectangles is // available. Set D3DTEXF_LINEAR when calling // TDx9_3DDevice::StretchRect() to utilize this filter. // D3DPTFILTERCAPS_MINFLINEAR : Support for bilinear // interpolation filtering for magnifying rectangles is // available. Set D3DTEXF_LINEAR when calling // TDx9_3DDevice::StretchRect() to utilize this filter. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetStretchRectFilterCaps() { return fD3DCAPS9.StretchRectFilterCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetStretchRectFilterCaps( dword pStretchRectFilterCaps ) { fD3DCAPS9.StretchRectFilterCaps = pStretchRectFilterCaps; } // -------------------------------------------------------------------------- // Property: TextureAddressCaps // Description: The TextureAddressCaps property defines the texture // addressing capabilities a texture object has available. // The described effect applies when the flag is set. // Flags: D3DPTADDRESSCAPS_BORDER - // Support for coordinates beyond the range 0.0 to 1.0 being // set to the border color is available. // Border color is specified by the D3DSAMP_BORDERCOLOR // texture stage state. // D3DPTADDRESSCAPS_CLAMP - // Support for clamping textures to addresses is available. // D3DPTADDRESSCAPS_INDEPENDENTUV - // Support for separate texture addressing modes for the u and // v coordinates is available. // This corresponds to the D3DSAMP_ADDRESSU and // D3DSAMP_ADDRESSV render state values of the // D3DSAMPLERSTATETYPE enumerated type. // D3DPTADDRESSCAPS_MIRROR - // Support for mirroring textures to addresses is available. // D3DPTADDRESSCAPS_MIRRORONCE - // Support for taking the absolute texture coordinate value // and clamping to the maximum value is available. // D3DPTADDRESSCAPS_WRAP - // Support for wrapping textures to addresses is available. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetTextureAddressCaps() { return fD3DCAPS9.TextureAddressCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetTextureAddressCaps( dword pTextureAddressCaps ) { fD3DCAPS9.TextureAddressCaps = pTextureAddressCaps; } // -------------------------------------------------------------------------- // Property: TextureCaps // Description: The TextureCaps property defines which texture mapping // capabilities are available. // The described effect applies when the flag is set. // Flags: D3DPTEXTURECAPS_ALPHA - // Support for alpha values in texture pixels is available. // D3DPTEXTURECAPS_ALPHAPALETTE - // Support for drawing alpha from texture palettes is // available. // D3DPTEXTURECAPS_CUBEMAP - // Support for cube textures is available. // D3DPTEXTURECAPS_CUBEMAP_POW2 - // Support for cube textures is restricted to those whose // dimensions are powers of two. // D3DPTEXTURECAPS_MIPCUBEMAP - // Support for mipmapped cube textures is available. // D3DPTEXTURECAPS_MIPMAP - // Support for mipmapped textures is available. // D3DPTEXTURECAPS_MIPVOLUMEMAP - // Support for mipmapped volume textures is available. // D3DPTEXTURECAPS_NONPOW2CONDITIONAL - // Support for non power of two dimension 2D textures is // available but only under the following conditions: // Texture addressing mode must be D3DTADDRESS_CLAMP // Texture wrapping is disabled: D3DRS_WRAPn = 0 // No mipmapping: magnification filter only // Texture format is not set to D3DFMT_DXT1 through to // D3DFMT_DXT5. // // When neither this flag or TextureCaps are set, // unconditional support for non power of two dimension // textures is available. // You cannot set a non power of two dimension texture at a // stage that is read based on shader computations. // D3DPTEXTURECAPS_NOPROJECTEDBUMPENV - // Support for a projected bump environment loopkup operation // in programmable and fixed function shaders is NOT // available. // D3DPTEXTURECAPS_PERSPECTIVE - // Support for perspective correction texturing is available. // D3DPTEXTURECAPS_POW2 - // When TextureCaps is not set, all textures except cube and // volume textures must have widths and heights that are a // power of two. // When TextureCaps is also set, conditional support of non // power of two dimensioned 2-D textures is available. // When neither this flag or TextureCaps are set, // unconditional support for non power of two dimension // textures is available. // D3DPTEXTURECAPS_PROJECTED - // Support for the D3DTTFF_PROJECTED texture transformation // option of the D3DTEXTURETRANSFORMFLAGS enumerated type is // available. // When present the device divides transformed texture // coordinates by the last texture coordinate on a per pixel // basis, otherwise the calculation is performed on a // per-vertex basis by Direct3D. // D3DPTEXTURECAPS_SQUAREONLY - // Support is restricted to square textures only. // D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE - // Support for scaling texture indices by texture size prior // to interpolation is NOT available. // D3DPTEXTURECAPS_VOLUMEMAP - // Support for volume textures is available. // D3DPTEXTURECAPS_VOLUMEMAP_POW2 - // Support for volume texture maps is restricted to those that // have powers of two dimensions. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetTextureCaps() { return fD3DCAPS9.TextureCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetTextureCaps( dword pTextureCaps ) { fD3DCAPS9.TextureCaps = pTextureCaps; } // -------------------------------------------------------------------------- // Property: TextureFilterCaps // Description: The TextureFilterCaps property defines the texture-filtering // capabilities of a texture. // Possible values are any combination of the per stage // filtering capabilties defined in the D3DPTFILTERCAPS // constant. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetTextureFilterCaps() { return fD3DCAPS9.TextureFilterCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetTextureFilterCaps( dword pTextureFilterCaps ) { fD3DCAPS9.TextureFilterCaps = pTextureFilterCaps; } // -------------------------------------------------------------------------- // Property: TextureOpCaps // Description: The TextureOpCaps property define which of the D3DTEXTUREOP // enumerated types texture operations are available. // The described effect applies when the flag is set. // Flags: D3DTEXOPCAPS_ADD - // Support for the D3DTOP_ADD texture-blending operation is // available. // D3DTEXOPCAPS_ADDSIGNED - // Support for the D3DTOP_ADDSIGNED texture-blending operation // is available. // D3DTEXOPCAPS_ADDSIGNED2X - // Support for the D3DTOP_ADDSIGNED2X texture-blending // operation is available. // D3DTEXOPCAPS_ADDSMOOTH - // Support for the D3DTOP_ADDSMOOTH texture-blending operation // is available. // D3DTEXOPCAPS_BLENDCURRENTALPHA - // Support for the D3DTOP_BLENDCURRENTALPHA texture-blending // operation is available. // D3DTEXOPCAPS_BLENDDIFFUSEALPHA - // Support for the D3DTOP_BLENDDIFFUSEALPHA texture-blending // operation is available. // D3DTEXOPCAPS_BLENDFACTORALPHA - // Support for the D3DTOP_BLENDFACTORALPHA texture-blending // operation is available. // D3DTEXOPCAPS_BLENDTEXTUREALPHA - // Support for the D3DTOP_BLENDTEXTUREALPHA texture-blending // operation is available. // D3DTEXOPCAPS_BLENDTEXTUREALPHAPM - // Support for the D3DTOP_BLENDTEXTUREALPHAPM texture-blending // operation is available. // D3DTEXOPCAPS_BUMPENVMAP - // Support for the D3DTOP_BUMPENVMAP texture-blending // operation is available. // D3DTEXOPCAPS_BUMPENVMAPLUMINANCE - // Support for the D3DTOP_BUMPENVMAPLUMINANCE texture-blending // operation is available. // D3DTEXOPCAPS_DISABLE - // Support for the D3DTOP_DISABLE texture-blending operation // is available. // D3DTEXOPCAPS_DOTPRODUCT3 - // Support for the D3DTOP_DOTPRODUCT3 texture-blending // operation is available. // D3DTEXOPCAPS_LERP - // Support for the D3DTOP_LERP texture-blending operation is // available. // D3DTEXOPCAPS_MODULATE - // Support for the D3DTOP_MODULATE texture-blending operation // is available. // D3DTEXOPCAPS_MODULATE2X - // Support for the D3DTOP_MODULATE2X texture-blending // operation is available. // D3DTEXOPCAPS_MODULATE4X - // Support for the D3DTOP_MODULATE4X texture-blending // operation is available. // D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR - // Support for the D3DTOP_MODULATEALPHA_ADDCOLOR // texture-blending operation is available. // D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA - // Support for the D3DTOP_MODULATECOLOR_ADDALPHA // texture-blending operation is available. // D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR - // Support for the D3DTOP_MODULATEINVALPHA_ADDCOLOR // texture-blending operation is available. // D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA - // Support for the D3DTOP_MODULATEINVCOLOR_ADDALPHA // texture-blending operation is available. // D3DTEXOPCAPS_MULTIPLYADD - // Support for the D3DTOP_MULTIPLYADD texture-blending // operation is available. // D3DTEXOPCAPS_PREMODULATE - // Support for the D3DTOP_PREMODULATE texture-blending // operation is available. // D3DTEXOPCAPS_SELECTARG1 - // Support for the D3DTOP_SELECTARG1 texture-blending // operation is available. // D3DTEXOPCAPS_SELECTARG2 - // Support for the D3DTOP_SELECTARG2 texture-blending // operation is available. // D3DTEXOPCAPS_SUBTRACT - // Support for the D3DTOP_SUBTRACT texture-blending operation // is available. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetTextureOpCaps() { return fD3DCAPS9.TextureOpCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetTextureOpCaps( dword pTextureOpCaps ) { fD3DCAPS9.TextureOpCaps = pTextureOpCaps; } // -------------------------------------------------------------------------- // Property: VS20Caps // Description: The VS20Caps property holds a TD3DVShaderCaps component // indicating what support for vertex shader version 2_0 // extended capability is available. // -------------------------------------------------------------------------- D3DVSHADERCAPS2_0 __fastcall TD3DCaps::FGetVS20Caps() { return fD3DCAPS9.VS20Caps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetVS20Caps( D3DVSHADERCAPS2_0 pVS20Caps ) { fD3DCAPS9.VS20Caps = pVS20Caps; } // -------------------------------------------------------------------------- // Property: VertexProcessingCaps // Description: The VertexProcessingCaps property defines which vertex // processing capabilities are available. // Possible values are defined by the D3DVTXPCAPS constant. // Capabilities for the same physical device may vary depending // on the parameters of the TDx9_3D::CreateDevice() call that // created the TDx9_3DDevice. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetVertexProcessingCaps() { return fD3DCAPS9.VertexProcessingCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetVertexProcessingCaps( dword pVertexProcessingCaps ) { fD3DCAPS9.VertexProcessingCaps = pVertexProcessingCaps; } // -------------------------------------------------------------------------- // Property: VertexShaderVersion // Description: The VertexShaderVersion defines two numbers representing the // vertex shader main and sub version. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetVertexShaderVersion() { return fD3DCAPS9.VertexShaderVersion; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetVertexShaderVersion( dword pVertexShaderVersion ) { fD3DCAPS9.VertexShaderVersion = pVertexShaderVersion; } // -------------------------------------------------------------------------- // Property: VertexTextureFilterCaps // Description: The VertexTextureFilterCaps property indicates that support // for vertex shader texture filter is available. // Possible values are defined by the D3DPTFILTERCAPS constant. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetVertexTextureFilterCaps() { return fD3DCAPS9.VertexTextureFilterCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetVertexTextureFilterCaps( dword pVertexTextureFilterCaps ) { fD3DCAPS9.VertexTextureFilterCaps = pVertexTextureFilterCaps; } // -------------------------------------------------------------------------- // Property: VolumeTextureAddressCaps // Description: The VolumeTextureAddressCaps property defines the texture // addressing capabilities a volume texture object has // available. // The described effect applies when the flag is set. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetVolumeTextureAddressCaps() { return fD3DCAPS9.VolumeTextureAddressCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetVolumeTextureAddressCaps( dword pVolumeTextureAddressCaps ) { fD3DCAPS9.VolumeTextureAddressCaps = pVolumeTextureAddressCaps; } // -------------------------------------------------------------------------- // Property: VolumeTextureFilterCaps // Description: The TextureFilterCaps property defines the texture-filtering // capabilities of a volume texture. // Possible values are any combination of the per stage // filtering capabilties defined in the D3DPTFILTERCAPS // constant. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetVolumeTextureFilterCaps() { return fD3DCAPS9.VolumeTextureFilterCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetVolumeTextureFilterCaps( dword pVolumeTextureFilterCaps ) { fD3DCAPS9.VolumeTextureFilterCaps = pVolumeTextureFilterCaps; } // -------------------------------------------------------------------------- // Property: ZCmpCaps // Description: The ZCmpCaps property defines which z-buffer comparison // capabilities are available. // The described effect applies when the flag is set. // Flags: D3DPCMPCAPS_ALWAYS - // Z-test will always be passed. // D3DPCMPCAPS_EQUAL - // Z-test will be passed if new z = current z. // D3DPCMPCAPS_GREATER - // Z-test will be passed if new z > current z. // D3DPCMPCAPS_GREATEREQUAL - // Z-test will be passed if new z >= current z. // D3DPCMPCAPS_LESS - // Z-test will be passed if new z < current z. // D3DPCMPCAPS_LESSEQUAL - // Z-test will be passed if new z <= current z. // D3DPCMPCAPS_NEVER - // Z-test will never be passed. // D3DPCMPCAPS_NOTEQUAL - // Z-test will be passed if new z != current z. // -------------------------------------------------------------------------- dword __fastcall TD3DCaps::FGetZCmpCaps() { return fD3DCAPS9.ZCmpCaps; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetZCmpCaps( dword pZCmpCaps ) { fD3DCAPS9.ZCmpCaps = pZCmpCaps; } // -------------------------------------------------------------------------- // Method: Clear() // Description: The Clear() method can be used to clear the contents of the // TD3DCaps's internal D3DCAPS9 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 TD3DCaps::Clear() { fD3DCAPS9.AdapterOrdinal = 0; fD3DCAPS9.AdapterOrdinalInGroup = 0; fD3DCAPS9.AlphaCmpCaps = 0; fD3DCAPS9.Caps = 0; fD3DCAPS9.Caps2 = 0; fD3DCAPS9.Caps3 = 0; fD3DCAPS9.CubeTextureFilterCaps = 0; fD3DCAPS9.CursorCaps = 0; fD3DCAPS9.DeclTypes = 0; fD3DCAPS9.DestBlendCaps = 0; fD3DCAPS9.DevCaps = 0; fD3DCAPS9.DevCaps2 = 0; fErrorValue = D3D_OK; fD3DCAPS9.ExtentsAdjust = 0; fD3DCAPS9.FVFCaps = 0; fD3DCAPS9.GuardBandBottom = 0; fD3DCAPS9.GuardBandLeft = 0; fD3DCAPS9.GuardBandRight = 0; fD3DCAPS9.GuardBandTop = 0; fD3DCAPS9.LineCaps = 0; fD3DCAPS9.MasterAdapterOrdinal = 0; fD3DCAPS9.MaxActiveLights = 0; fD3DCAPS9.MaxAnisotropy = 0; fD3DCAPS9.MaxNpatchTessellationLevel = 0; fD3DCAPS9.MaxPShaderInstructionsExecuted = 0; fD3DCAPS9.MaxPixelShader30InstructionSlots = 0; fD3DCAPS9.MaxPointSize = 0; fD3DCAPS9.MaxPrimitiveCount = 0; fD3DCAPS9.MaxSimultaneousTextures = 0; fD3DCAPS9.MaxStreamStride = 0; fD3DCAPS9.MaxStreams = 0; fD3DCAPS9.MaxTextureAspectRatio = 0; fD3DCAPS9.MaxTextureBlendStages = 0; fD3DCAPS9.MaxTextureHeight = 0; fD3DCAPS9.MaxTextureRepeat = 0; fD3DCAPS9.MaxTextureWidth = 0; fD3DCAPS9.MaxUserClipPlanes = 0; fD3DCAPS9.MaxVShaderInstructionsExecuted = 0; fD3DCAPS9.MaxVertexBlendMatrices = 0; fD3DCAPS9.MaxVertexBlendMatrixIndex = 0; fD3DCAPS9.MaxVertexIndex = 0; fD3DCAPS9.MaxVertexShader30InstructionSlots = 0; fD3DCAPS9.MaxVertexShaderConst = 0; fD3DCAPS9.MaxVertexW = 0; fD3DCAPS9.MaxVolumeExtent = 0; fD3DCAPS9.NumSimultaneousRTs = 0; fD3DCAPS9.NumberOfAdaptersInGroup = 0; fD3DCAPS9.PixelShader1xMaxValue = 0; fD3DCAPS9.PixelShaderVersion = 0; fD3DCAPS9.PresentationIntervals = 0; fD3DCAPS9.PrimitiveMiscCaps = 0; fD3DCAPS9.RasterCaps = 0; fD3DCAPS9.ShadeCaps = 0; fSize = sizeof(_D3DCAPS9); fD3DCAPS9.SrcBlendCaps = 0; fD3DCAPS9.StencilCaps = 0; fD3DCAPS9.StretchRectFilterCaps = 0; fD3DCAPS9.TextureAddressCaps = 0; fD3DCAPS9.TextureCaps = 0; fD3DCAPS9.TextureFilterCaps = 0; fD3DCAPS9.TextureOpCaps = 0; fD3DCAPS9.VertexProcessingCaps = 0; fD3DCAPS9.VertexShaderVersion = 0; fD3DCAPS9.VertexTextureFilterCaps = 0; fD3DCAPS9.VolumeTextureAddressCaps = 0; fD3DCAPS9.VolumeTextureFilterCaps = 0; fD3DCAPS9.ZCmpCaps = 0; } // -------------------------------------------------------------------------- // Internal Structure Access // -------------------------------------------------------------------------- D3DCAPS9* __fastcall TD3DCaps::FGetInternal_D3DCAPS9_Ptr() { return &fD3DCAPS9; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetInternal_D3DCAPS9( D3DCAPS9* pD3DCAPS9 ) { if (pD3DCAPS9==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DCaps::FSetInternal_D3DCAPS9()", "TDX_ERROR", "The supplied D3DCAPS9* was NULL" ); return; } CopyMemory( &fD3DCAPS9, pD3DCAPS9, sizeof(D3DCAPS9) ); Internal_D3DCAPS9_Update(); } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::Internal_D3DCAPS9_Update() { } // -------------------------------------------------------------------------- // Method: FGetAlphaCmpCaps_ // Description: This method returns a TD3DCaps_AlphaCmpCaps_Set<> of the // flags in the current fD3DCAPS9.AlphaCmpCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_ZCmpCaps_Set __fastcall TD3DCaps::FGetAlphaCmpCaps_() { TD3DCaps_ZCmpCaps_Set TempAlphaCmpCaps_; TempAlphaCmpCaps_.Clear(); if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_ALWAYS) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_always; if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_EQUAL) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_equal; if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_GREATER) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_greater; if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_GREATEREQUAL) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_greaterequal; if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_LESS) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_less; if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_LESSEQUAL) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_lessequal; if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_NEVER) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_never; if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_NOTEQUAL) TempAlphaCmpCaps_ = TempAlphaCmpCaps_ << d3dpcmpcaps_notequal; return TempAlphaCmpCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetAlphaCmpCaps_( TD3DCaps_ZCmpCaps_Set pAlphaCmpCaps_ ) { fD3DCAPS9.AlphaCmpCaps = 0; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_always)) fD3DCAPS9.AlphaCmpCaps |= D3DPCMPCAPS_ALWAYS; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_equal)) fD3DCAPS9.AlphaCmpCaps |= D3DPCMPCAPS_EQUAL; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_greater)) fD3DCAPS9.AlphaCmpCaps |= D3DPCMPCAPS_GREATER; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_greaterequal)) fD3DCAPS9.AlphaCmpCaps |= D3DPCMPCAPS_GREATEREQUAL; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_less)) fD3DCAPS9.AlphaCmpCaps |= D3DPCMPCAPS_LESS; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_lessequal)) fD3DCAPS9.AlphaCmpCaps |= D3DPCMPCAPS_LESSEQUAL; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_never)) fD3DCAPS9.AlphaCmpCaps |= D3DPCMPCAPS_NEVER; if (pAlphaCmpCaps_.Contains(d3dpcmpcaps_notequal)) fD3DCAPS9.AlphaCmpCaps |= 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 TD3DCaps::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, "TD3DCaps::FGetAlphaCmpCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various AlphaCmpCaps_Strings" ); return NULL; } } fAlphaCmpCaps_Strings->Clear(); if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_ALWAYS) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_ALWAYS"); if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_EQUAL) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_EQUAL"); if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_GREATER) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_GREATER"); if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_GREATEREQUAL) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_GREATEREQUAL"); if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_LESS) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_LESS"); if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_LESSEQUAL) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_LESSEQUAL"); if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_NEVER) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_NEVER"); if (fD3DCAPS9.AlphaCmpCaps & D3DPCMPCAPS_NOTEQUAL) fAlphaCmpCaps_Strings->Add("D3DPCMPCAPS_NOTEQUAL"); return fAlphaCmpCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetCaps_ // Description: This method returns a TD3DCaps_Caps_Set<> of the flags in the // current fD3DCAPS9.Caps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_Caps_Set __fastcall TD3DCaps::FGetCaps_() { TD3DCaps_Caps_Set TempCaps_; TempCaps_.Clear(); if (fD3DCAPS9.Caps & D3DCAPS_READ_SCANLINE) TempCaps_ = TempCaps_ << d3dcaps_read_scanline; return TempCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetCaps_( TD3DCaps_Caps_Set pCaps_ ) { fD3DCAPS9.Caps = 0; if (pCaps_.Contains(d3dcaps_read_scanline)) fD3DCAPS9.Caps |= D3DCAPS_READ_SCANLINE; } // -------------------------------------------------------------------------- // Method: FGetCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'Caps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DCaps::FGetCaps_Strings() { // if the strings have not been allocated if (fCaps_Strings==NULL) { // attempt to allocate the strings fCaps_Strings = new TStringList(); // if the allocation failed if (fCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DCaps::FGetCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various Caps_Strings" ); return NULL; } } fCaps_Strings->Clear(); if (fD3DCAPS9.Caps & D3DCAPS_READ_SCANLINE) fCaps_Strings->Add("D3DCAPS_READ_SCANLINE"); return fCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetCursorCaps_ // Description: This method returns a TD3DCaps_CursorCaps_Set<> of the flags // in the current fD3DCAPS9.CursorCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_CursorCaps_Set __fastcall TD3DCaps::FGetCursorCaps_() { TD3DCaps_CursorCaps_Set TempCursorCaps_; TempCursorCaps_.Clear(); if (fD3DCAPS9.CursorCaps & D3DCURSORCAPS_COLOR) TempCursorCaps_ = TempCursorCaps_ << d3dcursorcaps_color; if (fD3DCAPS9.CursorCaps & D3DCURSORCAPS_LOWRES) TempCursorCaps_ = TempCursorCaps_ << d3dcursorcaps_lowres; return TempCursorCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetCursorCaps_( TD3DCaps_CursorCaps_Set pCursorCaps_ ) { fD3DCAPS9.CursorCaps = 0; if (pCursorCaps_.Contains(d3dcursorcaps_color)) fD3DCAPS9.CursorCaps |= D3DCURSORCAPS_COLOR; if (pCursorCaps_.Contains(d3dcursorcaps_lowres)) fD3DCAPS9.CursorCaps |= D3DCURSORCAPS_LOWRES; } // -------------------------------------------------------------------------- // Method: FGetCursorCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'CursorCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DCaps::FGetCursorCaps_Strings() { // if the strings have not been allocated if (fCursorCaps_Strings==NULL) { // attempt to allocate the strings fCursorCaps_Strings = new TStringList(); // if the allocation failed if (fCursorCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DCaps::FGetCursorCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various CursorCaps_Strings" ); return NULL; } } fCursorCaps_Strings->Clear(); if (fD3DCAPS9.CursorCaps & D3DCURSORCAPS_COLOR) fCursorCaps_Strings->Add("D3DCURSORCAPS_COLOR"); if (fD3DCAPS9.CursorCaps & D3DCURSORCAPS_LOWRES) fCursorCaps_Strings->Add("D3DCURSORCAPS_LOWRES"); return fCursorCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetDestBlendCaps_ // Description: This method returns a TD3DCaps_DestBlendCaps_Set<> of the // flags in the current fD3DCAPS9.DestBlendCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_SrcBlendCaps_Set __fastcall TD3DCaps::FGetDestBlendCaps_() { TD3DCaps_SrcBlendCaps_Set TempDestBlendCaps_; TempDestBlendCaps_.Clear(); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_BLENDFACTOR) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_blendfactor; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_BOTHINVSRCALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_bothinvsrcalpha; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_BOTHSRCALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_bothsrcalpha; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_DESTALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_destalpha; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_DESTCOLOR) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_destcolor; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_INVDESTALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_invdestalpha; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_invdestcolor; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_invsrcalpha; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_INVSRCCOLOR) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_invsrccolor; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_ONE) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_one; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_SRCALPHA) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_srcalpha; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_SRCALPHASAT) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_srcalphasat; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_SRCCOLOR) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_srccolor; if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_ZERO) TempDestBlendCaps_ = TempDestBlendCaps_ << d3dpblendcaps_zero; return TempDestBlendCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetDestBlendCaps_( TD3DCaps_SrcBlendCaps_Set pDestBlendCaps_ ) { fD3DCAPS9.DestBlendCaps = 0; if (pDestBlendCaps_.Contains(d3dpblendcaps_blendfactor)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_BLENDFACTOR; if (pDestBlendCaps_.Contains(d3dpblendcaps_bothinvsrcalpha)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_BOTHINVSRCALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_bothsrcalpha)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_BOTHSRCALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_destalpha)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_DESTALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_destcolor)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_DESTCOLOR; if (pDestBlendCaps_.Contains(d3dpblendcaps_invdestalpha)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_INVDESTALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_invdestcolor)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_INVDESTCOLOR; if (pDestBlendCaps_.Contains(d3dpblendcaps_invsrcalpha)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_INVSRCALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_invsrccolor)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_INVSRCCOLOR; if (pDestBlendCaps_.Contains(d3dpblendcaps_one)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_ONE; if (pDestBlendCaps_.Contains(d3dpblendcaps_srcalpha)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_SRCALPHA; if (pDestBlendCaps_.Contains(d3dpblendcaps_srcalphasat)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_SRCALPHASAT; if (pDestBlendCaps_.Contains(d3dpblendcaps_srccolor)) fD3DCAPS9.DestBlendCaps |= D3DPBLENDCAPS_SRCCOLOR; if (pDestBlendCaps_.Contains(d3dpblendcaps_zero)) fD3DCAPS9.DestBlendCaps |= 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 TD3DCaps::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, "TD3DCaps::FGetDestBlendCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various DestBlendCaps_Strings" ); return NULL; } } fDestBlendCaps_Strings->Clear(); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_BLENDFACTOR) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_BLENDFACTOR"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_BOTHINVSRCALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_BOTHINVSRCALPHA"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_BOTHSRCALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_BOTHSRCALPHA"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_DESTALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_DESTALPHA"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_DESTCOLOR) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_DESTCOLOR"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_INVDESTALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_INVDESTALPHA"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_INVDESTCOLOR"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_INVSRCALPHA"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_INVSRCCOLOR) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_INVSRCCOLOR"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_ONE) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_ONE"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_SRCALPHA) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCALPHA"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_SRCALPHASAT) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCALPHASAT"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_SRCCOLOR) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCCOLOR"); if (fD3DCAPS9.DestBlendCaps & D3DPBLENDCAPS_ZERO) fDestBlendCaps_Strings->Add("D3DPBLENDCAPS_ZERO"); return fDestBlendCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetDevCaps_ // Description: This method returns a TD3DCaps_DevCaps_Set<> of the flags in // the current fD3DCAPS9.DevCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_DevCaps_Set __fastcall TD3DCaps::FGetDevCaps_() { TD3DCaps_DevCaps_Set TempDevCaps_; TempDevCaps_.Clear(); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_CANBLTSYSTONONLOCAL) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_canbltsystononlocal; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_CANRENDERAFTERFLIP) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_canrenderafterflip; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_DRAWPRIMITIVES2) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_drawprimitives2; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_drawprimitives2ex; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_DRAWPRIMTLVERTEX) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_drawprimtlvertex; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_EXECUTESYSTEMMEMORY) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_executesystemmemory; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_EXECUTEVIDEOMEMORY) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_executevideomemory; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_HWRASTERIZATION) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_hwrasterization; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_hwtransformandlight; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_NPATCHES) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_npatches; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_PUREDEVICE) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_puredevice; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_QUINTICRTPATCHES) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_quinticrtpatches; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_RTPATCHES) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_rtpatches; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_RTPATCHHANDLEZERO) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_rtpatchhandlezero; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_SEPARATETEXTUREMEMORIES) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_separatetexturememories; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_TEXTURENONLOCALVIDMEM) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_texturenonlocalvidmem; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_TEXTURESYSTEMMEMORY) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_texturesystemmemory; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_TEXTUREVIDEOMEMORY) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_texturevideomemory; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_TLVERTEXSYSTEMMEMORY) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_tlvertexsystemmemory; if (fD3DCAPS9.DevCaps & D3DDEVCAPS_TLVERTEXVIDEOMEMORY) TempDevCaps_ = TempDevCaps_ << d3ddevcaps_tlvertexvideomemory; return TempDevCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetDevCaps_( TD3DCaps_DevCaps_Set pDevCaps_ ) { fD3DCAPS9.DevCaps = 0; if (pDevCaps_.Contains(d3ddevcaps_canbltsystononlocal)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_CANBLTSYSTONONLOCAL; if (pDevCaps_.Contains(d3ddevcaps_canrenderafterflip)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_CANRENDERAFTERFLIP; if (pDevCaps_.Contains(d3ddevcaps_drawprimitives2)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_DRAWPRIMITIVES2; if (pDevCaps_.Contains(d3ddevcaps_drawprimitives2ex)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_DRAWPRIMITIVES2EX; if (pDevCaps_.Contains(d3ddevcaps_drawprimtlvertex)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_DRAWPRIMTLVERTEX; if (pDevCaps_.Contains(d3ddevcaps_executesystemmemory)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_EXECUTESYSTEMMEMORY; if (pDevCaps_.Contains(d3ddevcaps_executevideomemory)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_EXECUTEVIDEOMEMORY; if (pDevCaps_.Contains(d3ddevcaps_hwrasterization)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_HWRASTERIZATION; if (pDevCaps_.Contains(d3ddevcaps_hwtransformandlight)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_HWTRANSFORMANDLIGHT; if (pDevCaps_.Contains(d3ddevcaps_npatches)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_NPATCHES; if (pDevCaps_.Contains(d3ddevcaps_puredevice)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_PUREDEVICE; if (pDevCaps_.Contains(d3ddevcaps_quinticrtpatches)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_QUINTICRTPATCHES; if (pDevCaps_.Contains(d3ddevcaps_rtpatches)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_RTPATCHES; if (pDevCaps_.Contains(d3ddevcaps_rtpatchhandlezero)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_RTPATCHHANDLEZERO; if (pDevCaps_.Contains(d3ddevcaps_separatetexturememories)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_SEPARATETEXTUREMEMORIES; if (pDevCaps_.Contains(d3ddevcaps_texturenonlocalvidmem)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_TEXTURENONLOCALVIDMEM; if (pDevCaps_.Contains(d3ddevcaps_texturesystemmemory)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_TEXTURESYSTEMMEMORY; if (pDevCaps_.Contains(d3ddevcaps_texturevideomemory)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_TEXTUREVIDEOMEMORY; if (pDevCaps_.Contains(d3ddevcaps_tlvertexsystemmemory)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_TLVERTEXSYSTEMMEMORY; if (pDevCaps_.Contains(d3ddevcaps_tlvertexvideomemory)) fD3DCAPS9.DevCaps |= D3DDEVCAPS_TLVERTEXVIDEOMEMORY; } // -------------------------------------------------------------------------- // Method: FGetDevCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'DevCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DCaps::FGetDevCaps_Strings() { // if the strings have not been allocated if (fDevCaps_Strings==NULL) { // attempt to allocate the strings fDevCaps_Strings = new TStringList(); // if the allocation failed if (fDevCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DCaps::FGetDevCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various DevCaps_Strings" ); return NULL; } } fDevCaps_Strings->Clear(); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_CANBLTSYSTONONLOCAL) fDevCaps_Strings->Add("D3DDEVCAPS_CANBLTSYSTONONLOCAL"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_CANRENDERAFTERFLIP) fDevCaps_Strings->Add("D3DDEVCAPS_CANRENDERAFTERFLIP"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_DRAWPRIMITIVES2) fDevCaps_Strings->Add("D3DDEVCAPS_DRAWPRIMITIVES2"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) fDevCaps_Strings->Add("D3DDEVCAPS_DRAWPRIMITIVES2EX"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_DRAWPRIMTLVERTEX) fDevCaps_Strings->Add("D3DDEVCAPS_DRAWPRIMTLVERTEX"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_EXECUTESYSTEMMEMORY) fDevCaps_Strings->Add("D3DDEVCAPS_EXECUTESYSTEMMEMORY"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_EXECUTEVIDEOMEMORY) fDevCaps_Strings->Add("D3DDEVCAPS_EXECUTEVIDEOMEMORY"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_HWRASTERIZATION) fDevCaps_Strings->Add("D3DDEVCAPS_HWRASTERIZATION"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) fDevCaps_Strings->Add("D3DDEVCAPS_HWTRANSFORMANDLIGHT"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_NPATCHES) fDevCaps_Strings->Add("D3DDEVCAPS_NPATCHES"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_PUREDEVICE) fDevCaps_Strings->Add("D3DDEVCAPS_PUREDEVICE"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_QUINTICRTPATCHES) fDevCaps_Strings->Add("D3DDEVCAPS_QUINTICRTPATCHES"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_RTPATCHES) fDevCaps_Strings->Add("D3DDEVCAPS_RTPATCHES"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_RTPATCHHANDLEZERO) fDevCaps_Strings->Add("D3DDEVCAPS_RTPATCHHANDLEZERO"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_SEPARATETEXTUREMEMORIES) fDevCaps_Strings->Add("D3DDEVCAPS_SEPARATETEXTUREMEMORIES"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_TEXTURENONLOCALVIDMEM) fDevCaps_Strings->Add("D3DDEVCAPS_TEXTURENONLOCALVIDMEM"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_TEXTURESYSTEMMEMORY) fDevCaps_Strings->Add("D3DDEVCAPS_TEXTURESYSTEMMEMORY"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_TEXTUREVIDEOMEMORY) fDevCaps_Strings->Add("D3DDEVCAPS_TEXTUREVIDEOMEMORY"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_TLVERTEXSYSTEMMEMORY) fDevCaps_Strings->Add("D3DDEVCAPS_TLVERTEXSYSTEMMEMORY"); if (fD3DCAPS9.DevCaps & D3DDEVCAPS_TLVERTEXVIDEOMEMORY) fDevCaps_Strings->Add("D3DDEVCAPS_TLVERTEXVIDEOMEMORY"); return fDevCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetFVFCaps_ // Description: This method returns a TD3DCaps_FVFCaps_Set<> of the flags in // the current fD3DCAPS9.FVFCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_FVFCaps_Set __fastcall TD3DCaps::FGetFVFCaps_() { TD3DCaps_FVFCaps_Set TempFVFCaps_; TempFVFCaps_.Clear(); if (fD3DCAPS9.FVFCaps & D3DFVFCAPS_DONOTSTRIPELEMENTS) TempFVFCaps_ = TempFVFCaps_ << d3dfvfcaps_donotstripelements; if (fD3DCAPS9.FVFCaps & D3DFVFCAPS_PSIZE) TempFVFCaps_ = TempFVFCaps_ << d3dfvfcaps_psize; if (fD3DCAPS9.FVFCaps & D3DFVFCAPS_TEXCOORDCOUNTMASK) TempFVFCaps_ = TempFVFCaps_ << d3dfvfcaps_texcoordcountmask; return TempFVFCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetFVFCaps_( TD3DCaps_FVFCaps_Set pFVFCaps_ ) { fD3DCAPS9.FVFCaps = 0; if (pFVFCaps_.Contains(d3dfvfcaps_donotstripelements)) fD3DCAPS9.FVFCaps |= D3DFVFCAPS_DONOTSTRIPELEMENTS; if (pFVFCaps_.Contains(d3dfvfcaps_psize)) fD3DCAPS9.FVFCaps |= D3DFVFCAPS_PSIZE; if (pFVFCaps_.Contains(d3dfvfcaps_texcoordcountmask)) fD3DCAPS9.FVFCaps |= D3DFVFCAPS_TEXCOORDCOUNTMASK; } // -------------------------------------------------------------------------- // Method: FGetFVFCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'FVFCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DCaps::FGetFVFCaps_Strings() { // if the strings have not been allocated if (fFVFCaps_Strings==NULL) { // attempt to allocate the strings fFVFCaps_Strings = new TStringList(); // if the allocation failed if (fFVFCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DCaps::FGetFVFCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various FVFCaps_Strings" ); return NULL; } } fFVFCaps_Strings->Clear(); if (fD3DCAPS9.FVFCaps & D3DFVFCAPS_DONOTSTRIPELEMENTS) fFVFCaps_Strings->Add("D3DFVFCAPS_DONOTSTRIPELEMENTS"); if (fD3DCAPS9.FVFCaps & D3DFVFCAPS_PSIZE) fFVFCaps_Strings->Add("D3DFVFCAPS_PSIZE"); if (fD3DCAPS9.FVFCaps & D3DFVFCAPS_TEXCOORDCOUNTMASK) fFVFCaps_Strings->Add("D3DFVFCAPS_TEXCOORDCOUNTMASK"); return fFVFCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetLineCaps_ // Description: This method returns a TD3DCaps_LineCaps_Set<> of the flags in // the current fD3DCAPS9.LineCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_LineCaps_Set __fastcall TD3DCaps::FGetLineCaps_() { TD3DCaps_LineCaps_Set TempLineCaps_; TempLineCaps_.Clear(); if (fD3DCAPS9.LineCaps & D3DLINECAPS_ALPHACMP) TempLineCaps_ = TempLineCaps_ << d3dlinecaps_alphacmp; if (fD3DCAPS9.LineCaps & D3DLINECAPS_ANTIALIAS) TempLineCaps_ = TempLineCaps_ << d3dlinecaps_antialias; if (fD3DCAPS9.LineCaps & D3DLINECAPS_BLEND) TempLineCaps_ = TempLineCaps_ << d3dlinecaps_blend; if (fD3DCAPS9.LineCaps & D3DLINECAPS_FOG) TempLineCaps_ = TempLineCaps_ << d3dlinecaps_fog; if (fD3DCAPS9.LineCaps & D3DLINECAPS_TEXTURE) TempLineCaps_ = TempLineCaps_ << d3dlinecaps_texture; if (fD3DCAPS9.LineCaps & D3DLINECAPS_ZTEST) TempLineCaps_ = TempLineCaps_ << d3dlinecaps_ztest; return TempLineCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetLineCaps_( TD3DCaps_LineCaps_Set pLineCaps_ ) { fD3DCAPS9.LineCaps = 0; if (pLineCaps_.Contains(d3dlinecaps_alphacmp)) fD3DCAPS9.LineCaps |= D3DLINECAPS_ALPHACMP; if (pLineCaps_.Contains(d3dlinecaps_antialias)) fD3DCAPS9.LineCaps |= D3DLINECAPS_ANTIALIAS; if (pLineCaps_.Contains(d3dlinecaps_blend)) fD3DCAPS9.LineCaps |= D3DLINECAPS_BLEND; if (pLineCaps_.Contains(d3dlinecaps_fog)) fD3DCAPS9.LineCaps |= D3DLINECAPS_FOG; if (pLineCaps_.Contains(d3dlinecaps_texture)) fD3DCAPS9.LineCaps |= D3DLINECAPS_TEXTURE; if (pLineCaps_.Contains(d3dlinecaps_ztest)) fD3DCAPS9.LineCaps |= D3DLINECAPS_ZTEST; } // -------------------------------------------------------------------------- // Method: FGetLineCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'LineCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DCaps::FGetLineCaps_Strings() { // if the strings have not been allocated if (fLineCaps_Strings==NULL) { // attempt to allocate the strings fLineCaps_Strings = new TStringList(); // if the allocation failed if (fLineCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DCaps::FGetLineCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various LineCaps_Strings" ); return NULL; } } fLineCaps_Strings->Clear(); if (fD3DCAPS9.LineCaps & D3DLINECAPS_ALPHACMP) fLineCaps_Strings->Add("D3DLINECAPS_ALPHACMP"); if (fD3DCAPS9.LineCaps & D3DLINECAPS_ANTIALIAS) fLineCaps_Strings->Add("D3DLINECAPS_ANTIALIAS"); if (fD3DCAPS9.LineCaps & D3DLINECAPS_BLEND) fLineCaps_Strings->Add("D3DLINECAPS_BLEND"); if (fD3DCAPS9.LineCaps & D3DLINECAPS_FOG) fLineCaps_Strings->Add("D3DLINECAPS_FOG"); if (fD3DCAPS9.LineCaps & D3DLINECAPS_TEXTURE) fLineCaps_Strings->Add("D3DLINECAPS_TEXTURE"); if (fD3DCAPS9.LineCaps & D3DLINECAPS_ZTEST) fLineCaps_Strings->Add("D3DLINECAPS_ZTEST"); return fLineCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetPresentationIntervals_ // Description: This method returns a TD3DCaps_PresentationIntervals_Set<> of // the flags in the current fD3DCAPS9.PresentationIntervals. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_PresentationIntervals_Set __fastcall TD3DCaps::FGetPresentationIntervals_() { TD3DCaps_PresentationIntervals_Set TempPresentationIntervals_; TempPresentationIntervals_.Clear(); if (fD3DCAPS9.PresentationIntervals & D3DPRESENT_INTERVAL_FOUR) TempPresentationIntervals_ = TempPresentationIntervals_ << d3dpresent_interval_four; if (fD3DCAPS9.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE) TempPresentationIntervals_ = TempPresentationIntervals_ << d3dpresent_interval_immediate; if (fD3DCAPS9.PresentationIntervals & D3DPRESENT_INTERVAL_ONE) TempPresentationIntervals_ = TempPresentationIntervals_ << d3dpresent_interval_one; if (fD3DCAPS9.PresentationIntervals & D3DPRESENT_INTERVAL_THREE) TempPresentationIntervals_ = TempPresentationIntervals_ << d3dpresent_interval_three; if (fD3DCAPS9.PresentationIntervals & D3DPRESENT_INTERVAL_TWO) TempPresentationIntervals_ = TempPresentationIntervals_ << d3dpresent_interval_two; return TempPresentationIntervals_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetPresentationIntervals_( TD3DCaps_PresentationIntervals_Set pPresentationIntervals_ ) { fD3DCAPS9.PresentationIntervals = 0; if (pPresentationIntervals_.Contains(d3dpresent_interval_four)) fD3DCAPS9.PresentationIntervals |= D3DPRESENT_INTERVAL_FOUR; if (pPresentationIntervals_.Contains(d3dpresent_interval_immediate)) fD3DCAPS9.PresentationIntervals |= D3DPRESENT_INTERVAL_IMMEDIATE; if (pPresentationIntervals_.Contains(d3dpresent_interval_one)) fD3DCAPS9.PresentationIntervals |= D3DPRESENT_INTERVAL_ONE; if (pPresentationIntervals_.Contains(d3dpresent_interval_three)) fD3DCAPS9.PresentationIntervals |= D3DPRESENT_INTERVAL_THREE; if (pPresentationIntervals_.Contains(d3dpresent_interval_two)) fD3DCAPS9.PresentationIntervals |= D3DPRESENT_INTERVAL_TWO; } // -------------------------------------------------------------------------- // Method: FGetPresentationIntervals_Strings() // This method creates and then returns a TStringList containing // the current set of 'PresentationIntervals' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DCaps::FGetPresentationIntervals_Strings() { // if the strings have not been allocated if (fPresentationIntervals_Strings==NULL) { // attempt to allocate the strings fPresentationIntervals_Strings = new TStringList(); // if the allocation failed if (fPresentationIntervals_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DCaps::FGetPresentationIntervals_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various PresentationIntervals_Strings" ); return NULL; } } fPresentationIntervals_Strings->Clear(); if (fD3DCAPS9.PresentationIntervals & D3DPRESENT_INTERVAL_FOUR) fPresentationIntervals_Strings->Add("D3DPRESENT_INTERVAL_FOUR"); if (fD3DCAPS9.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE) fPresentationIntervals_Strings->Add("D3DPRESENT_INTERVAL_IMMEDIATE"); if (fD3DCAPS9.PresentationIntervals & D3DPRESENT_INTERVAL_ONE) fPresentationIntervals_Strings->Add("D3DPRESENT_INTERVAL_ONE"); if (fD3DCAPS9.PresentationIntervals & D3DPRESENT_INTERVAL_THREE) fPresentationIntervals_Strings->Add("D3DPRESENT_INTERVAL_THREE"); if (fD3DCAPS9.PresentationIntervals & D3DPRESENT_INTERVAL_TWO) fPresentationIntervals_Strings->Add("D3DPRESENT_INTERVAL_TWO"); return fPresentationIntervals_Strings; } // -------------------------------------------------------------------------- // Method: FGetRasterCaps_ // Description: This method returns a TD3DCaps_RasterCaps_Set<> of the flags // in the current fD3DCAPS9.RasterCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_RasterCaps_Set __fastcall TD3DCaps::FGetRasterCaps_() { TD3DCaps_RasterCaps_Set TempRasterCaps_; TempRasterCaps_.Clear(); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_ANISOTROPY) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_anisotropy; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_COLORPERSPECTIVE) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_colorperspective; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_DEPTHBIAS) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_depthbias; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_DITHER) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_dither; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_FOGRANGE) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_fogrange; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_FOGTABLE) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_fogtable; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_FOGVERTEX) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_fogvertex; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_MIPMAPLODBIAS) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_mipmaplodbias; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_MULTISAMPLE_TOGGLE) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_multisample_toggle; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_SCISSORTEST) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_scissortest; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_slopescaledepthbias; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_WBUFFER) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_wbuffer; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_WFOG) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_wfog; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_ZBUFFERLESSHSR) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_zbufferlesshsr; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_ZFOG) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_zfog; if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_ZTEST) TempRasterCaps_ = TempRasterCaps_ << d3dprastercaps_ztest; return TempRasterCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetRasterCaps_( TD3DCaps_RasterCaps_Set pRasterCaps_ ) { fD3DCAPS9.RasterCaps = 0; if (pRasterCaps_.Contains(d3dprastercaps_anisotropy)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_ANISOTROPY; if (pRasterCaps_.Contains(d3dprastercaps_colorperspective)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_COLORPERSPECTIVE; if (pRasterCaps_.Contains(d3dprastercaps_depthbias)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_DEPTHBIAS; if (pRasterCaps_.Contains(d3dprastercaps_dither)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_DITHER; if (pRasterCaps_.Contains(d3dprastercaps_fogrange)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_FOGRANGE; if (pRasterCaps_.Contains(d3dprastercaps_fogtable)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_FOGTABLE; if (pRasterCaps_.Contains(d3dprastercaps_fogvertex)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_FOGVERTEX; if (pRasterCaps_.Contains(d3dprastercaps_mipmaplodbias)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_MIPMAPLODBIAS; if (pRasterCaps_.Contains(d3dprastercaps_multisample_toggle)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_MULTISAMPLE_TOGGLE; if (pRasterCaps_.Contains(d3dprastercaps_scissortest)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_SCISSORTEST; if (pRasterCaps_.Contains(d3dprastercaps_slopescaledepthbias)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS; if (pRasterCaps_.Contains(d3dprastercaps_wbuffer)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_WBUFFER; if (pRasterCaps_.Contains(d3dprastercaps_wfog)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_WFOG; if (pRasterCaps_.Contains(d3dprastercaps_zbufferlesshsr)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_ZBUFFERLESSHSR; if (pRasterCaps_.Contains(d3dprastercaps_zfog)) fD3DCAPS9.RasterCaps |= D3DPRASTERCAPS_ZFOG; if (pRasterCaps_.Contains(d3dprastercaps_ztest)) fD3DCAPS9.RasterCaps |= 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 TD3DCaps::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, "TD3DCaps::FGetRasterCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various RasterCaps_Strings" ); return NULL; } } fRasterCaps_Strings->Clear(); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_ANISOTROPY) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ANISOTROPY"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_COLORPERSPECTIVE) fRasterCaps_Strings->Add("D3DPRASTERCAPS_COLORPERSPECTIVE"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_DEPTHBIAS) fRasterCaps_Strings->Add("D3DPRASTERCAPS_DEPTHBIAS"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_DITHER) fRasterCaps_Strings->Add("D3DPRASTERCAPS_DITHER"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_FOGRANGE) fRasterCaps_Strings->Add("D3DPRASTERCAPS_FOGRANGE"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_FOGTABLE) fRasterCaps_Strings->Add("D3DPRASTERCAPS_FOGTABLE"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_FOGVERTEX) fRasterCaps_Strings->Add("D3DPRASTERCAPS_FOGVERTEX"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_MIPMAPLODBIAS) fRasterCaps_Strings->Add("D3DPRASTERCAPS_MIPMAPLODBIAS"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_MULTISAMPLE_TOGGLE) fRasterCaps_Strings->Add("D3DPRASTERCAPS_MULTISAMPLE_TOGGLE"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_SCISSORTEST) fRasterCaps_Strings->Add("D3DPRASTERCAPS_SCISSORTEST"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS) fRasterCaps_Strings->Add("D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_WBUFFER) fRasterCaps_Strings->Add("D3DPRASTERCAPS_WBUFFER"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_WFOG) fRasterCaps_Strings->Add("D3DPRASTERCAPS_WFOG"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_ZBUFFERLESSHSR) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ZBUFFERLESSHSR"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_ZFOG) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ZFOG"); if (fD3DCAPS9.RasterCaps & D3DPRASTERCAPS_ZTEST) fRasterCaps_Strings->Add("D3DPRASTERCAPS_ZTEST"); return fRasterCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetShadeCaps_ // Description: This method returns a TD3DCaps_ShadeCaps_Set<> of the flags // in the current fD3DCAPS9.ShadeCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_ShadeCaps_Set __fastcall TD3DCaps::FGetShadeCaps_() { TD3DCaps_ShadeCaps_Set TempShadeCaps_; TempShadeCaps_.Clear(); if (fD3DCAPS9.ShadeCaps & D3DPSHADECAPS_ALPHAGOURAUDBLEND) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_alphagouraudblend; if (fD3DCAPS9.ShadeCaps & D3DPSHADECAPS_COLORGOURAUDRGB) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_colorgouraudrgb; if (fD3DCAPS9.ShadeCaps & D3DPSHADECAPS_FOGGOURAUD) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_foggouraud; if (fD3DCAPS9.ShadeCaps & D3DPSHADECAPS_SPECULARGOURAUDRGB) TempShadeCaps_ = TempShadeCaps_ << d3dpshadecaps_speculargouraudrgb; return TempShadeCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetShadeCaps_( TD3DCaps_ShadeCaps_Set pShadeCaps_ ) { fD3DCAPS9.ShadeCaps = 0; if (pShadeCaps_.Contains(d3dpshadecaps_alphagouraudblend)) fD3DCAPS9.ShadeCaps |= D3DPSHADECAPS_ALPHAGOURAUDBLEND; if (pShadeCaps_.Contains(d3dpshadecaps_colorgouraudrgb)) fD3DCAPS9.ShadeCaps |= D3DPSHADECAPS_COLORGOURAUDRGB; if (pShadeCaps_.Contains(d3dpshadecaps_foggouraud)) fD3DCAPS9.ShadeCaps |= D3DPSHADECAPS_FOGGOURAUD; if (pShadeCaps_.Contains(d3dpshadecaps_speculargouraudrgb)) fD3DCAPS9.ShadeCaps |= D3DPSHADECAPS_SPECULARGOURAUDRGB; } // -------------------------------------------------------------------------- // 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 TD3DCaps::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, "TD3DCaps::FGetShadeCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various ShadeCaps_Strings" ); return NULL; } } fShadeCaps_Strings->Clear(); if (fD3DCAPS9.ShadeCaps & D3DPSHADECAPS_ALPHAGOURAUDBLEND) fShadeCaps_Strings->Add("D3DPSHADECAPS_ALPHAGOURAUDBLEND"); if (fD3DCAPS9.ShadeCaps & D3DPSHADECAPS_COLORGOURAUDRGB) fShadeCaps_Strings->Add("D3DPSHADECAPS_COLORGOURAUDRGB"); if (fD3DCAPS9.ShadeCaps & D3DPSHADECAPS_FOGGOURAUD) fShadeCaps_Strings->Add("D3DPSHADECAPS_FOGGOURAUD"); if (fD3DCAPS9.ShadeCaps & D3DPSHADECAPS_SPECULARGOURAUDRGB) fShadeCaps_Strings->Add("D3DPSHADECAPS_SPECULARGOURAUDRGB"); return fShadeCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetSrcBlendCaps_ // Description: This method returns a TD3DCaps_SrcBlendCaps_Set<> of the // flags in the current fD3DCAPS9.SrcBlendCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_SrcBlendCaps_Set __fastcall TD3DCaps::FGetSrcBlendCaps_() { TD3DCaps_SrcBlendCaps_Set TempSrcBlendCaps_; TempSrcBlendCaps_.Clear(); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_BLENDFACTOR) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_blendfactor; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_BOTHINVSRCALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_bothinvsrcalpha; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_BOTHSRCALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_bothsrcalpha; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_DESTALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_destalpha; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_DESTCOLOR) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_destcolor; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_INVDESTALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_invdestalpha; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_invdestcolor; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_invsrcalpha; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_INVSRCCOLOR) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_invsrccolor; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_ONE) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_one; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_SRCALPHA) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_srcalpha; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_SRCALPHASAT) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_srcalphasat; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_SRCCOLOR) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_srccolor; if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_ZERO) TempSrcBlendCaps_ = TempSrcBlendCaps_ << d3dpblendcaps_zero; return TempSrcBlendCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetSrcBlendCaps_( TD3DCaps_SrcBlendCaps_Set pSrcBlendCaps_ ) { fD3DCAPS9.SrcBlendCaps = 0; if (pSrcBlendCaps_.Contains(d3dpblendcaps_blendfactor)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_BLENDFACTOR; if (pSrcBlendCaps_.Contains(d3dpblendcaps_bothinvsrcalpha)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_BOTHINVSRCALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_bothsrcalpha)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_BOTHSRCALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_destalpha)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_DESTALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_destcolor)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_DESTCOLOR; if (pSrcBlendCaps_.Contains(d3dpblendcaps_invdestalpha)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_INVDESTALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_invdestcolor)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_INVDESTCOLOR; if (pSrcBlendCaps_.Contains(d3dpblendcaps_invsrcalpha)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_INVSRCALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_invsrccolor)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_INVSRCCOLOR; if (pSrcBlendCaps_.Contains(d3dpblendcaps_one)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_ONE; if (pSrcBlendCaps_.Contains(d3dpblendcaps_srcalpha)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_SRCALPHA; if (pSrcBlendCaps_.Contains(d3dpblendcaps_srcalphasat)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_SRCALPHASAT; if (pSrcBlendCaps_.Contains(d3dpblendcaps_srccolor)) fD3DCAPS9.SrcBlendCaps |= D3DPBLENDCAPS_SRCCOLOR; if (pSrcBlendCaps_.Contains(d3dpblendcaps_zero)) fD3DCAPS9.SrcBlendCaps |= 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 TD3DCaps::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, "TD3DCaps::FGetSrcBlendCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various SrcBlendCaps_Strings" ); return NULL; } } fSrcBlendCaps_Strings->Clear(); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_BLENDFACTOR) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_BLENDFACTOR"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_BOTHINVSRCALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_BOTHINVSRCALPHA"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_BOTHSRCALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_BOTHSRCALPHA"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_DESTALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_DESTALPHA"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_DESTCOLOR) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_DESTCOLOR"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_INVDESTALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_INVDESTALPHA"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_INVDESTCOLOR"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_INVSRCALPHA"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_INVSRCCOLOR) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_INVSRCCOLOR"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_ONE) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_ONE"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_SRCALPHA) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCALPHA"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_SRCALPHASAT) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCALPHASAT"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_SRCCOLOR) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_SRCCOLOR"); if (fD3DCAPS9.SrcBlendCaps & D3DPBLENDCAPS_ZERO) fSrcBlendCaps_Strings->Add("D3DPBLENDCAPS_ZERO"); return fSrcBlendCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetTextureAddressCaps_ // Description: This method returns a TD3DCaps_TextureAddressCaps_Set<> of // the flags in the current fD3DCAPS9.TextureAddressCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_TextureAddressCaps_Set __fastcall TD3DCaps::FGetTextureAddressCaps_() { TD3DCaps_TextureAddressCaps_Set TempTextureAddressCaps_; TempTextureAddressCaps_.Clear(); if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_BORDER) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_border; if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_CLAMP) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_clamp; if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_INDEPENDENTUV) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_independentuv; if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_MIRROR) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_mirror; if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_MIRRORONCE) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_mirroronce; if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_WRAP) TempTextureAddressCaps_ = TempTextureAddressCaps_ << d3dptaddresscaps_wrap; return TempTextureAddressCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetTextureAddressCaps_( TD3DCaps_TextureAddressCaps_Set pTextureAddressCaps_ ) { fD3DCAPS9.TextureAddressCaps = 0; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_border)) fD3DCAPS9.TextureAddressCaps |= D3DPTADDRESSCAPS_BORDER; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_clamp)) fD3DCAPS9.TextureAddressCaps |= D3DPTADDRESSCAPS_CLAMP; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_independentuv)) fD3DCAPS9.TextureAddressCaps |= D3DPTADDRESSCAPS_INDEPENDENTUV; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_mirror)) fD3DCAPS9.TextureAddressCaps |= D3DPTADDRESSCAPS_MIRROR; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_mirroronce)) fD3DCAPS9.TextureAddressCaps |= D3DPTADDRESSCAPS_MIRRORONCE; if (pTextureAddressCaps_.Contains(d3dptaddresscaps_wrap)) fD3DCAPS9.TextureAddressCaps |= 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 TD3DCaps::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, "TD3DCaps::FGetTextureAddressCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various TextureAddressCaps_Strings" ); return NULL; } } fTextureAddressCaps_Strings->Clear(); if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_BORDER) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_BORDER"); if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_CLAMP) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_CLAMP"); if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_INDEPENDENTUV) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_INDEPENDENTUV"); if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_MIRROR) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_MIRROR"); if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_MIRRORONCE) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_MIRRORONCE"); if (fD3DCAPS9.TextureAddressCaps & D3DPTADDRESSCAPS_WRAP) fTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_WRAP"); return fTextureAddressCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetTextureCaps_ // Description: This method returns a TD3DCaps_TextureCaps_Set<> of the flags // in the current fD3DCAPS9.TextureCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_TextureCaps_Set __fastcall TD3DCaps::FGetTextureCaps_() { TD3DCaps_TextureCaps_Set TempTextureCaps_; TempTextureCaps_.Clear(); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_ALPHA) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_alpha; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_alphapalette; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_CUBEMAP) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_cubemap; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_CUBEMAP_POW2) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_cubemap_pow2; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_mipcubemap; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_MIPMAP) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_mipmap; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_MIPVOLUMEMAP) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_mipvolumemap; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_nonpow2conditional; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_NOPROJECTEDBUMPENV) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_noprojectedbumpenv; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_perspective; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_POW2) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_pow2; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_PROJECTED) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_projected; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_SQUAREONLY) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_squareonly; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_texrepeatnotscaledbysize; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_volumemap; if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP_POW2) TempTextureCaps_ = TempTextureCaps_ << d3dptexturecaps_volumemap_pow2; return TempTextureCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetTextureCaps_( TD3DCaps_TextureCaps_Set pTextureCaps_ ) { fD3DCAPS9.TextureCaps = 0; if (pTextureCaps_.Contains(d3dptexturecaps_alpha)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_ALPHA; if (pTextureCaps_.Contains(d3dptexturecaps_alphapalette)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_ALPHAPALETTE; if (pTextureCaps_.Contains(d3dptexturecaps_cubemap)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_CUBEMAP; if (pTextureCaps_.Contains(d3dptexturecaps_cubemap_pow2)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_CUBEMAP_POW2; if (pTextureCaps_.Contains(d3dptexturecaps_mipcubemap)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_MIPCUBEMAP; if (pTextureCaps_.Contains(d3dptexturecaps_mipmap)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_MIPMAP; if (pTextureCaps_.Contains(d3dptexturecaps_mipvolumemap)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_MIPVOLUMEMAP; if (pTextureCaps_.Contains(d3dptexturecaps_nonpow2conditional)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_NONPOW2CONDITIONAL; if (pTextureCaps_.Contains(d3dptexturecaps_noprojectedbumpenv)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_NOPROJECTEDBUMPENV; if (pTextureCaps_.Contains(d3dptexturecaps_perspective)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_PERSPECTIVE; if (pTextureCaps_.Contains(d3dptexturecaps_pow2)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_POW2; if (pTextureCaps_.Contains(d3dptexturecaps_projected)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_PROJECTED; if (pTextureCaps_.Contains(d3dptexturecaps_squareonly)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_SQUAREONLY; if (pTextureCaps_.Contains(d3dptexturecaps_texrepeatnotscaledbysize)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE; if (pTextureCaps_.Contains(d3dptexturecaps_volumemap)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_VOLUMEMAP; if (pTextureCaps_.Contains(d3dptexturecaps_volumemap_pow2)) fD3DCAPS9.TextureCaps |= D3DPTEXTURECAPS_VOLUMEMAP_POW2; } // -------------------------------------------------------------------------- // 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 TD3DCaps::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, "TD3DCaps::FGetTextureCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various TextureCaps_Strings" ); return NULL; } } fTextureCaps_Strings->Clear(); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_ALPHA) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_ALPHA"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_ALPHAPALETTE"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_CUBEMAP) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_CUBEMAP"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_CUBEMAP_POW2) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_CUBEMAP_POW2"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_MIPCUBEMAP"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_MIPMAP) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_MIPMAP"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_MIPVOLUMEMAP) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_MIPVOLUMEMAP"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_NONPOW2CONDITIONAL"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_NOPROJECTEDBUMPENV) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_NOPROJECTEDBUMPENV"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_PERSPECTIVE"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_POW2) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_POW2"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_PROJECTED) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_PROJECTED"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_SQUAREONLY) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_SQUAREONLY"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_VOLUMEMAP"); if (fD3DCAPS9.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP_POW2) fTextureCaps_Strings->Add("D3DPTEXTURECAPS_VOLUMEMAP_POW2"); return fTextureCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetTextureOpCaps_ // Description: This method returns a TD3DCaps_TextureOpCaps_Set<> of the // flags in the current fD3DCAPS9.TextureOpCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_TextureOpCaps_Set __fastcall TD3DCaps::FGetTextureOpCaps_() { TD3DCaps_TextureOpCaps_Set TempTextureOpCaps_; TempTextureOpCaps_.Clear(); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_ADD) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_add; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_ADDSIGNED) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_addsigned; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_ADDSIGNED2X) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_addsigned2x; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_ADDSMOOTH) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_addsmooth; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BLENDCURRENTALPHA) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_blendcurrentalpha; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BLENDDIFFUSEALPHA) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_blenddiffusealpha; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BLENDFACTORALPHA) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_blendfactoralpha; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BLENDTEXTUREALPHA) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_blendtexturealpha; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BLENDTEXTUREALPHAPM) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_blendtexturealphapm; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAP) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_bumpenvmap; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAPLUMINANCE) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_bumpenvmapluminance; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_DISABLE) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_disable; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_dotproduct3; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_LERP) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_lerp; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATE) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_modulate; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATE2X) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_modulate2x; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATE4X) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_modulate4x; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_modulatealpha_addcolor; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_modulatecolor_addalpha; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_modulateinvalpha_addcolor; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_modulateinvcolor_addalpha; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MULTIPLYADD) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_multiplyadd; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_PREMODULATE) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_premodulate; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_SELECTARG1) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_selectarg1; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_SELECTARG2) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_selectarg2; if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_SUBTRACT) TempTextureOpCaps_ = TempTextureOpCaps_ << d3dtexopcaps_subtract; return TempTextureOpCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetTextureOpCaps_( TD3DCaps_TextureOpCaps_Set pTextureOpCaps_ ) { fD3DCAPS9.TextureOpCaps = 0; if (pTextureOpCaps_.Contains(d3dtexopcaps_add)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_ADD; if (pTextureOpCaps_.Contains(d3dtexopcaps_addsigned)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_ADDSIGNED; if (pTextureOpCaps_.Contains(d3dtexopcaps_addsigned2x)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_ADDSIGNED2X; if (pTextureOpCaps_.Contains(d3dtexopcaps_addsmooth)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_ADDSMOOTH; if (pTextureOpCaps_.Contains(d3dtexopcaps_blendcurrentalpha)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_BLENDCURRENTALPHA; if (pTextureOpCaps_.Contains(d3dtexopcaps_blenddiffusealpha)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_BLENDDIFFUSEALPHA; if (pTextureOpCaps_.Contains(d3dtexopcaps_blendfactoralpha)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_BLENDFACTORALPHA; if (pTextureOpCaps_.Contains(d3dtexopcaps_blendtexturealpha)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_BLENDTEXTUREALPHA; if (pTextureOpCaps_.Contains(d3dtexopcaps_blendtexturealphapm)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_BLENDTEXTUREALPHAPM; if (pTextureOpCaps_.Contains(d3dtexopcaps_bumpenvmap)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_BUMPENVMAP; if (pTextureOpCaps_.Contains(d3dtexopcaps_bumpenvmapluminance)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_BUMPENVMAPLUMINANCE; if (pTextureOpCaps_.Contains(d3dtexopcaps_disable)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_DISABLE; if (pTextureOpCaps_.Contains(d3dtexopcaps_dotproduct3)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_DOTPRODUCT3; if (pTextureOpCaps_.Contains(d3dtexopcaps_lerp)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_LERP; if (pTextureOpCaps_.Contains(d3dtexopcaps_modulate)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_MODULATE; if (pTextureOpCaps_.Contains(d3dtexopcaps_modulate2x)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_MODULATE2X; if (pTextureOpCaps_.Contains(d3dtexopcaps_modulate4x)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_MODULATE4X; if (pTextureOpCaps_.Contains(d3dtexopcaps_modulatealpha_addcolor)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR; if (pTextureOpCaps_.Contains(d3dtexopcaps_modulatecolor_addalpha)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA; if (pTextureOpCaps_.Contains(d3dtexopcaps_modulateinvalpha_addcolor)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR; if (pTextureOpCaps_.Contains(d3dtexopcaps_modulateinvcolor_addalpha)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA; if (pTextureOpCaps_.Contains(d3dtexopcaps_multiplyadd)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_MULTIPLYADD; if (pTextureOpCaps_.Contains(d3dtexopcaps_premodulate)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_PREMODULATE; if (pTextureOpCaps_.Contains(d3dtexopcaps_selectarg1)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_SELECTARG1; if (pTextureOpCaps_.Contains(d3dtexopcaps_selectarg2)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_SELECTARG2; if (pTextureOpCaps_.Contains(d3dtexopcaps_subtract)) fD3DCAPS9.TextureOpCaps |= D3DTEXOPCAPS_SUBTRACT; } // -------------------------------------------------------------------------- // Method: FGetTextureOpCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'TextureOpCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DCaps::FGetTextureOpCaps_Strings() { // if the strings have not been allocated if (fTextureOpCaps_Strings==NULL) { // attempt to allocate the strings fTextureOpCaps_Strings = new TStringList(); // if the allocation failed if (fTextureOpCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DCaps::FGetTextureOpCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various TextureOpCaps_Strings" ); return NULL; } } fTextureOpCaps_Strings->Clear(); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_ADD) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_ADD"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_ADDSIGNED) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_ADDSIGNED"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_ADDSIGNED2X) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_ADDSIGNED2X"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_ADDSMOOTH) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_ADDSMOOTH"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BLENDCURRENTALPHA) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_BLENDCURRENTALPHA"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BLENDDIFFUSEALPHA) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_BLENDDIFFUSEALPHA"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BLENDFACTORALPHA) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_BLENDFACTORALPHA"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BLENDTEXTUREALPHA) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_BLENDTEXTUREALPHA"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BLENDTEXTUREALPHAPM) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_BLENDTEXTUREALPHAPM"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAP) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_BUMPENVMAP"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAPLUMINANCE) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_BUMPENVMAPLUMINANCE"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_DISABLE) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_DISABLE"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_DOTPRODUCT3"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_LERP) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_LERP"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATE) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_MODULATE"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATE2X) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_MODULATE2X"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATE4X) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_MODULATE4X"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_MULTIPLYADD) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_MULTIPLYADD"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_PREMODULATE) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_PREMODULATE"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_SELECTARG1) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_SELECTARG1"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_SELECTARG2) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_SELECTARG2"); if (fD3DCAPS9.TextureOpCaps & D3DTEXOPCAPS_SUBTRACT) fTextureOpCaps_Strings->Add("D3DTEXOPCAPS_SUBTRACT"); return fTextureOpCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetVolumeTextureAddressCaps_ // Description: This method returns a TD3DCaps_VolumeTextureAddressCaps_Set<> // of the flags in the current // fD3DCAPS9.VolumeTextureAddressCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_TextureAddressCaps_Set __fastcall TD3DCaps::FGetVolumeTextureAddressCaps_() { TD3DCaps_TextureAddressCaps_Set TempVolumeTextureAddressCaps_; TempVolumeTextureAddressCaps_.Clear(); if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_BORDER) TempVolumeTextureAddressCaps_ = TempVolumeTextureAddressCaps_ << d3dptaddresscaps_border; if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_CLAMP) TempVolumeTextureAddressCaps_ = TempVolumeTextureAddressCaps_ << d3dptaddresscaps_clamp; if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_INDEPENDENTUV) TempVolumeTextureAddressCaps_ = TempVolumeTextureAddressCaps_ << d3dptaddresscaps_independentuv; if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_MIRROR) TempVolumeTextureAddressCaps_ = TempVolumeTextureAddressCaps_ << d3dptaddresscaps_mirror; if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_MIRRORONCE) TempVolumeTextureAddressCaps_ = TempVolumeTextureAddressCaps_ << d3dptaddresscaps_mirroronce; if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_WRAP) TempVolumeTextureAddressCaps_ = TempVolumeTextureAddressCaps_ << d3dptaddresscaps_wrap; return TempVolumeTextureAddressCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetVolumeTextureAddressCaps_( TD3DCaps_TextureAddressCaps_Set pVolumeTextureAddressCaps_ ) { fD3DCAPS9.VolumeTextureAddressCaps = 0; if (pVolumeTextureAddressCaps_.Contains(d3dptaddresscaps_border)) fD3DCAPS9.VolumeTextureAddressCaps |= D3DPTADDRESSCAPS_BORDER; if (pVolumeTextureAddressCaps_.Contains(d3dptaddresscaps_clamp)) fD3DCAPS9.VolumeTextureAddressCaps |= D3DPTADDRESSCAPS_CLAMP; if (pVolumeTextureAddressCaps_.Contains(d3dptaddresscaps_independentuv)) fD3DCAPS9.VolumeTextureAddressCaps |= D3DPTADDRESSCAPS_INDEPENDENTUV; if (pVolumeTextureAddressCaps_.Contains(d3dptaddresscaps_mirror)) fD3DCAPS9.VolumeTextureAddressCaps |= D3DPTADDRESSCAPS_MIRROR; if (pVolumeTextureAddressCaps_.Contains(d3dptaddresscaps_mirroronce)) fD3DCAPS9.VolumeTextureAddressCaps |= D3DPTADDRESSCAPS_MIRRORONCE; if (pVolumeTextureAddressCaps_.Contains(d3dptaddresscaps_wrap)) fD3DCAPS9.VolumeTextureAddressCaps |= D3DPTADDRESSCAPS_WRAP; } // -------------------------------------------------------------------------- // Method: FGetVolumeTextureAddressCaps_Strings() // This method creates and then returns a TStringList containing // the current set of 'VolumeTextureAddressCaps' flags. // Note: You must manually delete the retrieved TStringList after use // to avoid memory corruption. // -------------------------------------------------------------------------- TStringList* __fastcall TD3DCaps::FGetVolumeTextureAddressCaps_Strings() { // if the strings have not been allocated if (fVolumeTextureAddressCaps_Strings==NULL) { // attempt to allocate the strings fVolumeTextureAddressCaps_Strings = new TStringList(); // if the allocation failed if (fVolumeTextureAddressCaps_Strings==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TD3DCaps::FGetVolumeTextureAddressCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various VolumeTextureAddressCaps_Strings" ); return NULL; } } fVolumeTextureAddressCaps_Strings->Clear(); if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_BORDER) fVolumeTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_BORDER"); if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_CLAMP) fVolumeTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_CLAMP"); if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_INDEPENDENTUV) fVolumeTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_INDEPENDENTUV"); if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_MIRROR) fVolumeTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_MIRROR"); if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_MIRRORONCE) fVolumeTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_MIRRORONCE"); if (fD3DCAPS9.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_WRAP) fVolumeTextureAddressCaps_Strings->Add("D3DPTADDRESSCAPS_WRAP"); return fVolumeTextureAddressCaps_Strings; } // -------------------------------------------------------------------------- // Method: FGetZCmpCaps_ // Description: This method returns a TD3DCaps_ZCmpCaps_Set<> of the flags in // the current fD3DCAPS9.ZCmpCaps. // Note: Wrapper components use the following method to modify flags // via the BCB Object Inspector. // -------------------------------------------------------------------------- TD3DCaps_ZCmpCaps_Set __fastcall TD3DCaps::FGetZCmpCaps_() { TD3DCaps_ZCmpCaps_Set TempZCmpCaps_; TempZCmpCaps_.Clear(); if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_ALWAYS) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_always; if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_EQUAL) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_equal; if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_GREATER) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_greater; if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_GREATEREQUAL) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_greaterequal; if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_LESS) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_less; if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_LESSEQUAL) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_lessequal; if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_NEVER) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_never; if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_NOTEQUAL) TempZCmpCaps_ = TempZCmpCaps_ << d3dpcmpcaps_notequal; return TempZCmpCaps_; } // -------------------------------------------------------------------------- void __fastcall TD3DCaps::FSetZCmpCaps_( TD3DCaps_ZCmpCaps_Set pZCmpCaps_ ) { fD3DCAPS9.ZCmpCaps = 0; if (pZCmpCaps_.Contains(d3dpcmpcaps_always)) fD3DCAPS9.ZCmpCaps |= D3DPCMPCAPS_ALWAYS; if (pZCmpCaps_.Contains(d3dpcmpcaps_equal)) fD3DCAPS9.ZCmpCaps |= D3DPCMPCAPS_EQUAL; if (pZCmpCaps_.Contains(d3dpcmpcaps_greater)) fD3DCAPS9.ZCmpCaps |= D3DPCMPCAPS_GREATER; if (pZCmpCaps_.Contains(d3dpcmpcaps_greaterequal)) fD3DCAPS9.ZCmpCaps |= D3DPCMPCAPS_GREATEREQUAL; if (pZCmpCaps_.Contains(d3dpcmpcaps_less)) fD3DCAPS9.ZCmpCaps |= D3DPCMPCAPS_LESS; if (pZCmpCaps_.Contains(d3dpcmpcaps_lessequal)) fD3DCAPS9.ZCmpCaps |= D3DPCMPCAPS_LESSEQUAL; if (pZCmpCaps_.Contains(d3dpcmpcaps_never)) fD3DCAPS9.ZCmpCaps |= D3DPCMPCAPS_NEVER; if (pZCmpCaps_.Contains(d3dpcmpcaps_notequal)) fD3DCAPS9.ZCmpCaps |= 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 TD3DCaps::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, "TD3DCaps::FGetZCmpCaps_Strings()", "TDX_ERROR", "Could not allocate memory used to retrieve various ZCmpCaps_Strings" ); return NULL; } } fZCmpCaps_Strings->Clear(); if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_ALWAYS) fZCmpCaps_Strings->Add("D3DPCMPCAPS_ALWAYS"); if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_EQUAL) fZCmpCaps_Strings->Add("D3DPCMPCAPS_EQUAL"); if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_GREATER) fZCmpCaps_Strings->Add("D3DPCMPCAPS_GREATER"); if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_GREATEREQUAL) fZCmpCaps_Strings->Add("D3DPCMPCAPS_GREATEREQUAL"); if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_LESS) fZCmpCaps_Strings->Add("D3DPCMPCAPS_LESS"); if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_LESSEQUAL) fZCmpCaps_Strings->Add("D3DPCMPCAPS_LESSEQUAL"); if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_NEVER) fZCmpCaps_Strings->Add("D3DPCMPCAPS_NEVER"); if (fD3DCAPS9.ZCmpCaps & D3DPCMPCAPS_NOTEQUAL) fZCmpCaps_Strings->Add("D3DPCMPCAPS_NOTEQUAL"); return fZCmpCaps_Strings; } // --------------------------------------------------------------------------