MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / translateVertexProgramRef

Method translateVertexProgramRef

OgreMain/src/OgreScriptTranslator.cpp:2994–3018  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2992 }
2993 //-------------------------------------------------------------------------
2994 void PassTranslator::translateVertexProgramRef(ScriptCompiler *compiler, ObjectAbstractNode *node)
2995 {
2996 if(node->name.empty())
2997 {
2998 compiler->addError(ScriptCompiler::CE_OBJECTNAMEEXPECTED, node->file, node->line);
2999 return;
3000 }
3001
3002 ProcessResourceNameScriptCompilerEvent evt(ProcessResourceNameScriptCompilerEvent::GPU_PROGRAM, node->name);
3003 compiler->_fireEvent(&evt, 0);
3004
3005 if (!GpuProgramManager::getSingleton().getByName(evt.mName))
3006 {
3007 compiler->addError(ScriptCompiler::CE_REFERENCETOANONEXISTINGOBJECT, node->file, node->line);
3008 return;
3009 }
3010
3011 Pass *pass = any_cast<Pass*>(node->parent->context);
3012 pass->setVertexProgram(evt.mName);
3013 if(pass->getVertexProgram()->isSupported())
3014 {
3015 GpuProgramParametersSharedPtr params = pass->getVertexProgramParameters();
3016 GpuProgramTranslator::translateProgramParameters(compiler, params, node);
3017 }
3018 }
3019 //-------------------------------------------------------------------------
3020 void PassTranslator::translateGeometryProgramRef(ScriptCompiler *compiler, ObjectAbstractNode *node)
3021 {

Callers

nothing calls this directly

Calls 7

addErrorMethod · 0.80
_fireEventMethod · 0.80
emptyMethod · 0.45
getByNameMethod · 0.45
setVertexProgramMethod · 0.45
isSupportedMethod · 0.45

Tested by

no test coverage detected