本文整理汇总了C++中Shader::GetShaderParameters方法的典型用法代码示例。如果您正苦于以下问题:C++ Shader::GetShaderParameters方法的具体用法?C++ Shader::GetShaderParameters怎么用?C++ Shader::GetShaderParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shader
的用法示例。
在下文中一共展示了Shader::GetShaderParameters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateShader
FPS_UINT32 MaterialManager::CreateShader(
const MATERIAL_SHADER &p_ShaderInfo,
std::list< std::string > &p_ShaderParameters,
MD5_DIGEST &p_ShaderDigest )
{
Shader *pMaterialShader = new Shader( );
if( p_ShaderInfo.Types & SHADER_TYPE_VERTEX )
{
if( pMaterialShader->CreateShaderFromSource(
p_ShaderInfo.VertexSource, SHADER_TYPE_VERTEX,
p_ShaderInfo.VertexFile ) != FPS_OK )
{
std::cout << "[FPS::MaterialManager::CreateShader] <ERROR> "
"Failed to compile the vertex shader" << std::endl;
return FPS_FAIL;
}
}
if( p_ShaderInfo.Types & SHADER_TYPE_FRAGMENT )
{
if( pMaterialShader->CreateShaderFromSource(
p_ShaderInfo.FragmentSource, SHADER_TYPE_FRAGMENT,
p_ShaderInfo.FragmentFile ) != FPS_OK )
{
std::cout << "[FPS::MaterialManager::CreateShader] <ERROR> "
"Failed to compile the vertex shader" << std::endl;
return FPS_FAIL;
}
}
if( p_ShaderInfo.Types & SHADER_TYPE_GEOMETRY )
{
if( pMaterialShader->CreateShaderFromSource(
p_ShaderInfo.GeometrySource, SHADER_TYPE_GEOMETRY,
p_ShaderInfo.GeometryFile ) != FPS_OK )
{
std::cout << "[FPS::MaterialManager::CreateShader] <ERROR> "
"Failed to compile the vertex shader" << std::endl;
return FPS_FAIL;
}
}
pMaterialShader->GetShaderParameters( p_ShaderParameters );
pMaterialShader->Link( );
pMaterialShader->GetDigest( p_ShaderDigest );
std::pair< std::map< MD5_DIGEST, Shader * >::iterator, bool >
ShaderMapResult;
ShaderMapResult = m_Shaders.insert( std::pair< MD5_DIGEST, Shader * >(
p_ShaderDigest, pMaterialShader ) );
if( ShaderMapResult.second == false )
{
// The shader wasn't added, so delete it
std::cout << "[FPS::MaterialManager::CreateShader] <INFO> "
"Duplicate shader detected, not adding" << std::endl;
SafeDelete< Shader >( pMaterialShader );
}
return FPS_OK;
}