本文整理汇总了C++中GpuProgramParametersSharedPtr::getSharedParameters方法的典型用法代码示例。如果您正苦于以下问题:C++ GpuProgramParametersSharedPtr::getSharedParameters方法的具体用法?C++ GpuProgramParametersSharedPtr::getSharedParameters怎么用?C++ GpuProgramParametersSharedPtr::getSharedParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GpuProgramParametersSharedPtr
的用法示例。
在下文中一共展示了GpuProgramParametersSharedPtr::getSharedParameters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateUniformBlocks
//-----------------------------------------------------------------------
void GLSLESProgramPipeline::updateUniformBlocks(GpuProgramParametersSharedPtr params,
uint16 mask, GpuProgramType fromProgType)
{
#if OGRE_NO_GLES3_SUPPORT == 0
// Iterate through the list of uniform buffers and update them as needed
GLUniformBufferIterator currentBuffer = mGLUniformBufferReferences.begin();
GLUniformBufferIterator endBuffer = mGLUniformBufferReferences.end();
const GpuProgramParameters::GpuSharedParamUsageList& sharedParams = params->getSharedParameters();
GpuProgramParameters::GpuSharedParamUsageList::const_iterator it, end = sharedParams.end();
for (it = sharedParams.begin(); it != end; ++it)
{
for (;currentBuffer != endBuffer; ++currentBuffer)
{
GLES2HardwareUniformBuffer* hwGlBuffer = static_cast<GLES2HardwareUniformBuffer*>(currentBuffer->get());
GpuSharedParametersPtr paramsPtr = it->getSharedParams();
// Block name is stored in mSharedParams->mName of GpuSharedParamUsageList items
GLint UniformTransform;
OGRE_CHECK_GL_ERROR(UniformTransform = glGetUniformBlockIndex(mGLProgramHandle, it->getName().c_str()));
OGRE_CHECK_GL_ERROR(glUniformBlockBinding(mGLProgramHandle, UniformTransform, hwGlBuffer->getGLBufferBinding()));
hwGlBuffer->writeData(0, hwGlBuffer->getSizeInBytes(), ¶msPtr->getFloatConstantList().front());
}
}
#endif
}