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

Method createImpl

RenderSystems/GLES2/src/OgreGLES2GpuProgramManager.cpp:59–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 Resource* GLES2GpuProgramManager::createImpl(const String& name,
60 ResourceHandle handle,
61 const String& group, bool isManual,
62 ManualResourceLoader* loader,
63 const NameValuePairList* params)
64 {
65 NameValuePairList::const_iterator paramSyntax, paramType;
66
67 if (!params || (paramSyntax = params->find("syntax")) == params->end() ||
68 (paramType = params->find("type")) == params->end())
69 {
70 OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
71 "You must supply 'syntax' and 'type' parameters",
72 "GLES2GpuProgramManager::createImpl");
73 }
74
75 ProgramMap::const_iterator iter = mProgramMap.find(paramSyntax->second);
76 if(iter == mProgramMap.end())
77 {
78 // No factory, this is an unsupported syntax code, probably for another rendersystem
79 // Create a basic one, it doesn't matter what it is since it won't be used
80 // we have to forward the syntax code though
81 GpuProgram* ret = new GLSLESShader(this, name, handle, group, isManual, loader);
82 ret->setSyntaxCode(paramSyntax->second);
83 return ret;
84 }
85
86 GpuProgramType gpt;
87 if (paramType->second == "vertex_program")
88 {
89 gpt = GPT_VERTEX_PROGRAM;
90 }
91 else
92 {
93 gpt = GPT_FRAGMENT_PROGRAM;
94 }
95
96 return (iter->second)(this, name, handle, group, isManual,
97 loader, gpt, paramSyntax->second);
98 }
99
100 Resource* GLES2GpuProgramManager::createImpl(const String& name,
101 ResourceHandle handle,

Callers

nothing calls this directly

Calls 3

setSyntaxCodeMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected