📄 shaderapiempty.cpp
字号:
//-----------------------------------------------------------------------------
// Shutdown
//-----------------------------------------------------------------------------
void CShaderAPIEmpty::Shutdown( )
{
}
// Gets the number of adapters...
int CShaderAPIEmpty::GetDisplayAdapterCount() const
{
return 0;
}
// Returns info about each adapter
void CShaderAPIEmpty::GetDisplayAdapterInfo( int adapter, MaterialAdapterInfo_t& info ) const
{
}
// Returns the number of modes
int CShaderAPIEmpty::GetModeCount( int adapter ) const
{
return 0;
}
// Returns mode information..
void CShaderAPIEmpty::GetModeInfo( int adapter, int mode, MaterialVideoMode_t& info ) const
{
}
// Returns the mode info for the current display device
void CShaderAPIEmpty::GetDisplayMode( MaterialVideoMode_t& info ) const
{
}
void CShaderAPIEmpty::Get3DDriverInfo( Material3DDriverInfo_t &info ) const
{
}
bool CShaderAPIEmpty::Prefer16BitTextures( ) const
{
return true;
}
// Can we download textures?
bool CShaderAPIEmpty::CanDownloadTextures() const
{
return false;
}
// Are we using graphics?
bool CShaderAPIEmpty::IsUsingGraphics() const
{
return false;
}
// Used to clear the transition table when we know it's become invalid.
void CShaderAPIEmpty::ClearSnapshots()
{
}
// Sets the mode...
bool CShaderAPIEmpty::SetMode( void* hwnd, MaterialVideoMode_t const& mode, int flags, int nSampleCount )
{
return true;
}
void CShaderAPIEmpty::GetWindowSize( int &width, int &height ) const
{
width = 0;
height = 0;
}
// Creates/ destroys a child window
bool CShaderAPIEmpty::AddView( void* hwnd )
{
return true;
}
void CShaderAPIEmpty::RemoveView( void* hwnd )
{
}
// Activates a view
void CShaderAPIEmpty::SetView( void* hwnd )
{
}
// Members of IMaterialSystemHardwareConfig
bool CShaderAPIEmpty::HasAlphaBuffer() const
{
return false;
}
bool CShaderAPIEmpty::HasStencilBuffer() const
{
return false;
}
bool CShaderAPIEmpty::HasARBMultitexture() const
{
return true;
}
bool CShaderAPIEmpty::HasNVRegisterCombiners() const
{
return false;
}
bool CShaderAPIEmpty::HasTextureEnvCombine() const
{
return false;
}
int CShaderAPIEmpty::GetFrameBufferColorDepth() const
{
return 0;
}
int CShaderAPIEmpty::GetNumTextureUnits() const
{
if ((ShaderUtil()->GetConfig().dxSupportLevel > 0) &&
(ShaderUtil()->GetConfig().dxSupportLevel < 60))
return 1;
if (( ShaderUtil()->GetConfig().dxSupportLevel >= 60 ) && ( ShaderUtil()->GetConfig().dxSupportLevel < 80 ))
return 2;
return 4;
}
bool CShaderAPIEmpty::HasIteratorsPerTextureUnit() const
{
return false;
}
bool CShaderAPIEmpty::HasSetDeviceGammaRamp() const
{
return false;
}
bool CShaderAPIEmpty::SupportsCompressedTextures() const
{
return false;
}
bool CShaderAPIEmpty::SupportsVertexAndPixelShaders() const
{
if ((ShaderUtil()->GetConfig().dxSupportLevel > 0) &&
(ShaderUtil()->GetConfig().dxSupportLevel < 80))
return false;
return true;
}
bool CShaderAPIEmpty::SupportsPixelShaders_1_4() const
{
if ((ShaderUtil()->GetConfig().dxSupportLevel > 0) &&
(ShaderUtil()->GetConfig().dxSupportLevel < 81))
return false;
return true;
}
bool CShaderAPIEmpty::SupportsPixelShaders_2_0() const
{
if ((ShaderUtil()->GetConfig().dxSupportLevel > 0) &&
(ShaderUtil()->GetConfig().dxSupportLevel < 90))
return false;
return true;
}
bool CShaderAPIEmpty::SupportsVertexShaders_2_0() const
{
if ((ShaderUtil()->GetConfig().dxSupportLevel > 0) &&
(ShaderUtil()->GetConfig().dxSupportLevel < 90))
return false;
return true;
}
bool CShaderAPIEmpty::SupportsPartialTextureDownload() const
{
return false;
}
bool CShaderAPIEmpty::SupportsStateSnapshotting() const
{
return true;
}
int CShaderAPIEmpty::MaximumAnisotropicLevel() const
{
return 0;
}
void CShaderAPIEmpty::SetAnisotropicLevel( int nAnisotropyLevel )
{
}
int CShaderAPIEmpty::MaxTextureWidth() const
{
// Should be big enough to cover all cases
return 16384;
}
int CShaderAPIEmpty::MaxTextureHeight() const
{
// Should be big enough to cover all cases
return 16384;
}
int CShaderAPIEmpty::MaxTextureAspectRatio() const
{
// Should be big enough to cover all cases
return 16384;
}
int CShaderAPIEmpty::TextureMemorySize() const
{
// fake it
return 64 * 1024 * 1024;
}
int CShaderAPIEmpty::GetDXSupportLevel() const
{
if (ShaderUtil()->GetConfig().dxSupportLevel != 0)
return ShaderUtil()->GetConfig().dxSupportLevel;
return 90;
}
bool CShaderAPIEmpty::SupportsOverbright() const
{
return false;
}
bool CShaderAPIEmpty::SupportsCubeMaps() const
{
if ((ShaderUtil()->GetConfig().dxSupportLevel > 0) &&
(ShaderUtil()->GetConfig().dxSupportLevel < 70))
return false;
return true;
}
bool CShaderAPIEmpty::SupportsNonPow2Textures() const
{
return true;
}
bool CShaderAPIEmpty::SupportsMipmappedCubemaps() const
{
if ((ShaderUtil()->GetConfig().dxSupportLevel > 0) &&
(ShaderUtil()->GetConfig().dxSupportLevel < 70))
return false;
return true;
}
int CShaderAPIEmpty::GetNumTextureStages() const
{
return 4;
}
int CShaderAPIEmpty::NumVertexShaderConstants() const
{
return 128;
}
int CShaderAPIEmpty::NumPixelShaderConstants() const
{
return 8;
}
int CShaderAPIEmpty::MaxNumLights() const
{
return 4;
}
bool CShaderAPIEmpty::SupportsSpheremapping() const
{
return false;
}
bool CShaderAPIEmpty::HasFastZReject() const
{
return false;
}
bool CShaderAPIEmpty::SupportsHardwareLighting() const
{
if ((ShaderUtil()->GetConfig().dxSupportLevel > 0) &&
(ShaderUtil()->GetConfig().dxSupportLevel < 70))
return false;
return true;
}
int CShaderAPIEmpty::MaxBlendMatrices() const
{
if ((ShaderUtil()->GetConfig().dxSupportLevel > 0) &&
(ShaderUtil()->GetConfig().dxSupportLevel < 70))
{
return 1;
}
return 0;
}
int CShaderAPIEmpty::MaxBlendMatrixIndices() const
{
if ((ShaderUtil()->GetConfig().dxSupportLevel > 0) &&
(ShaderUtil()->GetConfig().dxSupportLevel < 70))
{
return 1;
}
return 0;
}
int CShaderAPIEmpty::MaxVertexShaderBlendMatrices() const
{
return 0;
}
int CShaderAPIEmpty::MaxUserClipPlanes() const
{
return 0;
}
const char *CShaderAPIEmpty::GetHWSpecificShaderDLLName() const
{
return 0;
}
// Sets the default *dynamic* state
void CShaderAPIEmpty::SetDefaultState()
{
}
// Returns the snapshot id for the shader state
StateSnapshot_t CShaderAPIEmpty::TakeSnapshot( )
{
StateSnapshot_t id = 0;
if (g_ShaderShadow.m_IsTranslucent)
id |= TRANSLUCENT;
if (g_ShaderShadow.m_IsAlphaTested)
id |= ALPHATESTED;
if (g_ShaderShadow.m_UsesAmbientCube)
id |= AMBIENT_CUBE;
if (g_ShaderShadow.m_bUsesVertexAndPixelShaders)
id |= VERTEX_AND_PIXEL_SHADERS;
return id;
}
// Returns true if the state snapshot is transparent
bool CShaderAPIEmpty::IsTranslucent( StateSnapshot_t id ) const
{
return (id & TRANSLUCENT) != 0;
}
bool CShaderAPIEmpty::IsAlphaTested( StateSnapshot_t id ) const
{
return (id & ALPHATESTED) != 0;
}
bool CShaderAPIEmpty::UsesAmbientCube( StateSnapshot_t id ) const
{
return (id & AMBIENT_CUBE) != 0;
}
bool CShaderAPIEmpty::UsesVertexAndPixelShaders( StateSnapshot_t id ) const
{
return (id & VERTEX_AND_PIXEL_SHADERS) != 0;
}
// Gets the vertex format for a set of snapshot ids
VertexFormat_t CShaderAPIEmpty::ComputeVertexFormat( int numSnapshots, StateSnapshot_t* pIds ) const
{
return 0;
}
// Gets the vertex format for a set of snapshot ids
VertexFormat_t CShaderAPIEmpty::ComputeVertexUsage( int numSnapshots, StateSnapshot_t* pIds ) const
{
return 0;
}
// Uses a state snapshot
void CShaderAPIEmpty::UseSnapshot( StateSnapshot_t snapshot )
{
}
// Sets the color to modulate by
void CShaderAPIEmpty::Color3f( float r, float g, float b )
{
}
void CShaderAPIEmpty::Color3fv( float const* pColor )
{
}
void CShaderAPIEmpty::Color4f( float r, float g, float b, float a )
{
}
void CShaderAPIEmpty::Color4fv( float const* pColor )
{
}
// Faster versions of color
void CShaderAPIEmpty::Color3ub( unsigned char r, unsigned char g, unsigned char b )
{
}
void CShaderAPIEmpty::Color3ubv( unsigned char const* rgb )
{
}
void CShaderAPIEmpty::Color4ub( unsigned char r, unsigned char g, unsigned char b, unsigned char a )
{
}
void CShaderAPIEmpty::Color4ubv( unsigned char const* rgba )
{
}
// The shade mode
void CShaderAPIEmpty::ShadeMode( ShaderShadeMode_t mode )
{
}
// Binds a particular material to render with
void CShaderAPIEmpty::Bind( IMaterial* pMaterial )
{
}
// Cull mode
void CShaderAPIEmpty::CullMode( MaterialCullMode_t cullMode )
{
}
void CShaderAPIEmpty::ForceDepthFuncEquals( bool bEnable )
{
}
// Forces Z buffering on or off
void CShaderAPIEmpty::OverrideDepthEnable( bool bEnable, bool bDepthEnable )
{
}
// Sets the lights
void CShaderAPIEmpty::SetLight( int lightNum, LightDesc_t& desc )
{
}
void CShaderAPIEmpty::SetAmbientLight( float r, float g, float b )
{
}
void CShaderAPIEmpty::SetAmbientLightCube( Vector4D cube[6] )
{
}
// Get lights
int CShaderAPIEmpty::GetMaxLights( void ) const
{
return 0;
}
const LightDesc_t& CShaderAPIEmpty::GetLight( int lightNum ) const
{
static LightDesc_t blah;
return blah;
}
// Render state for the ambient light cube (vertex shaders)
void CShaderAPIEmpty::SetVertexShaderStateAmbientLightCube()
{
}
void CShaderAPIEmpty::SetSkinningMatrices()
{
}
// Render state for the ambient light cube (pixel shaders)
void CShaderAPIEmpty::BindAmbientLightCubeToStage0( )
{
}
// Lightmap texture binding
void CShaderAPIEmpty::BindLightmap( TextureStage_t stage )
{
}
void CShaderAPIEmpty::BindBumpLightmap( TextureStage_t stage )
{
}
void CShaderAPIEmpty::BindWhite( TextureStage_t stage )
{
}
void CShaderAPIEmpty::BindBlack( TextureStage_t stage )
{
}
void CShaderAPIEmpty::BindGrey( TextureStage_t stage )
{
}
// Gets the lightmap dimensions
void CShaderAPIEmpty::GetLightmapDimensions( int *w, int *h )
{
g_pShaderUtil->GetLightmapDimensions( w, h );
}
// Special system flat normal map binding.
void CShaderAPIEmpty::BindFlatNormalMap( TextureStage_t stage )
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -