Esempio n. 1
0
 ShaderPtr Shader::clone(ProgramPtr prog) const
 {
   ShaderPtr s(new Shader(prog, m_type));
   s->setFilename(rawFilename());
   s->m_src = m_src;
   s->m_needCompile = true;
   if (prog) prog->setIsCompiled(false);
   return s;
 }
Esempio n. 2
0
 bool Shader::loadSrc(const QString& data)
 {
   if (m_src != data) {
     m_src = data;
     m_needCompile = true;
     // Tell the program object, that it needs to recompile stuff
     ProgramPtr p = m_prog.lock();
     if (p) p->setIsCompiled(false);
     return true;
   }
   return false;
 }