本文整理汇总了C++中IShader::CreateConstantBuffers方法的典型用法代码示例。如果您正苦于以下问题:C++ IShader::CreateConstantBuffers方法的具体用法?C++ IShader::CreateConstantBuffers怎么用?C++ IShader::CreateConstantBuffers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IShader
的用法示例。
在下文中一共展示了IShader::CreateConstantBuffers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadShaders
void XCShaderContainer::LoadShaders()
{
IShader* binShader;
FlatBuffersSystem& fbSystem = SystemLocator::GetInstance()->RequestSystem<FlatBuffersSystem>("FlatBuffersSystem");
fbSystem.ParseAndLoadFile(SHADER_SCHEMA_FILEPATH, m_fbBuffer);
fbSystem.ParseAndLoadFile(SHADER_DATA_FILEPATH, m_fbBuffer);
#if defined(LOAD_SHADERS_FROM_DATA)
auto FBShadersRoot = GetFBRootShader(m_fbBuffer.GetBufferFromLoadedData());
for (auto it = FBShadersRoot->FBShaders()->begin(); it != FBShadersRoot->FBShaders()->end(); ++it)
{
binShader = XCNEW(XCShaderHandle)();
binShader->Load((void*) *it);
m_Shaders[it->ShaderUsage()] = binShader;
}
#else
for (u32 shaderIndex = 0; shaderIndex < ShaderType_Max; shaderIndex++)
{
switch (shaderIndex)
{
case ShaderType_DEFAULT:
{
binShader = new DefaultShader(m_device);
binShader->LoadShader();
binShader->CreateConstantBuffers();
m_Shaders[ShaderType_DEFAULT] = binShader;
break;
}
case ShaderType_SolidColor:
{
binShader = new SolidColorShader(m_device);
binShader->LoadShader();
binShader->CreateConstantBuffers();
m_Shaders[ShaderType_SolidColor] = binShader;
break;
}
case ShaderType_LightTexture:
{
binShader = new LightTextureShader(m_device);
binShader->LoadShader();
binShader->CreateConstantBuffers();
m_Shaders[ShaderType_LightTexture] = binShader;
break;
}
case ShaderType_REFELECTED_LIGHTTEXTURE:
{
binShader = new XCShaderHandle(m_device);
binShader->LoadShader();
binShader->CreateConstantBuffers();
m_Shaders[ShaderType_REFELECTED_LIGHTTEXTURE] = binShader;
break;
}
case ShaderType_TerrainMultiTexture:
{
binShader = new TerrainMultiTex(m_device);
binShader->LoadShader();
binShader->CreateConstantBuffers();
m_Shaders[ShaderType_TerrainMultiTexture] = binShader;
break;
}
case ShaderType_SimpleCubeMap:
{
binShader = new CubeMapShader(m_device);
binShader->LoadShader();
binShader->CreateConstantBuffers();
m_Shaders[ShaderType_SimpleCubeMap] = binShader;
break;
}
case ShaderType_SkinnedCharacter:
{
binShader = new SkinnedCharacterShader(m_device);
binShader->LoadShader();
binShader->CreateConstantBuffers();
m_Shaders[ShaderType_SkinnedCharacter] = binShader;
break;
}
case ShaderType_Max:
break;
default:
break;
}
}
#endif
//.........这里部分代码省略.........