本文整理汇总了C++中ogre::GpuProgramParametersSharedPtr::copyMatchingNamedConstantsFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ GpuProgramParametersSharedPtr::copyMatchingNamedConstantsFrom方法的具体用法?C++ GpuProgramParametersSharedPtr::copyMatchingNamedConstantsFrom怎么用?C++ GpuProgramParametersSharedPtr::copyMatchingNamedConstantsFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::GpuProgramParametersSharedPtr
的用法示例。
在下文中一共展示了GpuProgramParametersSharedPtr::copyMatchingNamedConstantsFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void gkDebugScreen::initialize()
{
if (m_isInit)
return;
try
{
m_font = new gkBuiltinFont;
Ogre::FontPtr fp = Ogre::FontManager::getSingleton().create("<gkBuiltin/Font>", GK_BUILTIN_GROUP, true, m_font);
fp->load();
#define FONT_MATERIAL 1
#if FONT_MATERIAL
#ifndef OGREKIT_USE_OLD
gkString ShareMaterail = "Examples/BumpMapping/MultiLight";
static int Use_Init_Once = 0;
if(Use_Init_Once < 2)
{
Ogre::FileInfoListPtr fileInfoList =
Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(
"",
"*.material");
for (Ogre::FileInfoList::const_iterator cit=fileInfoList->begin();
cit != fileInfoList->end();
++cit) {
const Ogre::String& name = cit->filename;
const Ogre::String& basename = cit->basename;
Ogre::String sType = cit->archive->getType();
Ogre::String sPath = cit->archive->getName();
if (sType=="Zip" || sType=="FileSystem") {
Ogre::DataStreamPtr pData=
Ogre::ResourceGroupManager::getSingleton().openResource(
basename,"");
Ogre::MaterialManager::getSingleton().parseScript(
pData, "");
Ogre::MaterialManager::getSingleton().load(basename,"");
}
}
Use_Init_Once++;
}
#endif
Ogre::MaterialPtr ShareMaterailPtr = Ogre::MaterialManager::getSingleton().getByName(ShareMaterail, "");
if (!ShareMaterailPtr.isNull())
{
ShareMaterailPtr->load();
//ShareMaterailPtr->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("textureCount",1);
}
Ogre::MaterialPtr oma = Ogre::MaterialManager::getSingleton().getByName("Fonts/<gkBuiltin/Font>");
if (!oma.isNull())
{
Ogre::Pass* pass1 = oma->getTechnique(0)->getPass(0);
Ogre::GpuProgramPtr vsPtr = Ogre::HighLevelGpuProgramManager::getSingleton().getByName("FixVs");
if (vsPtr.isNull())
{
LogManager::getSingleton().logMessage("GpuProgramPtr NULL");
}
gkString VertexProgramName = "FixVs";
gkString FragmentProgramName ="FixPs";
if (pass1)
{
pass1->setVertexProgram(VertexProgramName);
pass1->setFragmentProgram(FragmentProgramName);
Ogre::GpuProgramParametersSharedPtr vsParams = pass1->getVertexProgramParameters();
vsParams->copyMatchingNamedConstantsFrom(*ShareMaterailPtr->getTechnique(0)->getPass(0)->getVertexProgramParameters().get());
Ogre::GpuProgramParametersSharedPtr psParams = pass1->getFragmentProgramParameters();
psParams->copyMatchingNamedConstantsFrom(*ShareMaterailPtr->getTechnique(0)->getPass(0)->getFragmentProgramParameters().get());
//psParams->setNamedConstant("textureCount",1);
//psParams->setNamedConstant("AlphaValue",0.0f);
//vsParams->setNamedConstant("lightOpen",0);
LogManager::getSingleton().logMessage("set font es2.0");
}
}
#endif
Ogre::OverlayManager& mgr = Ogre::OverlayManager::getSingleton();
m_over = mgr.create("<gkBuiltin/gkDebugScreen>");
m_ele = mgr.createOverlayElement("TextArea", "<gkBuiltin/gkDebugScreen/TextArea>");
Ogre::OverlayContainer* cont = (Ogre::OverlayContainer*)mgr.createOverlayElement("BorderPanel", "<gkBuiltin/gkDebugScreen/Containter>");
cont->setMetricsMode(Ogre::GMM_PIXELS);
cont->setVerticalAlignment(Ogre::GVA_TOP);
const gkVector2& dims = gkWindowSystem::getSingleton().getMouse()->winsize;
m_ele->setMetricsMode(Ogre::GMM_PIXELS);
m_ele->setVerticalAlignment(Ogre::GVA_TOP);
m_ele->setPosition(0, 0);
m_ele->setDimensions(dims.x, dims.y);
Ogre::TextAreaOverlayElement* textArea = static_cast<Ogre::TextAreaOverlayElement*>(m_ele);
//.........这里部分代码省略.........