//----------------------------------------------------------------------- void ProgramWriter::writeProgramTitle( #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID StringSerialiser& os, #else std::ostream &os, #endif Program* program) { os << "//-----------------------------------------------------------------------------" << ENDL; os << "// Program Type: "; switch(program->getType()) { case GPT_VERTEX_PROGRAM: os << "Vertex shader"; break; case GPT_FRAGMENT_PROGRAM: os << "Fragment shader"; break; case GPT_GEOMETRY_PROGRAM: os << "Geometry shader"; break; default: break; } os << ENDL; os << "// Language: " << getTargetLanguage() << ENDL; os << "// Created by Ogre RT Shader Generator. All rights reserved." << ENDL; os << "//-----------------------------------------------------------------------------" << ENDL; }
//----------------------------------------------------------------------- void ProgramWriter::writeProgramTitle( std::ostream &os, Program* program) { os << "//-----------------------------------------------------------------------------" << std::endl; os << "// Program Type: "; switch(program->getType()) { case GPT_VERTEX_PROGRAM: os << "Vertex shader"; break; case GPT_FRAGMENT_PROGRAM: os << "Fragment shader"; break; case GPT_GEOMETRY_PROGRAM: os << "Geometry shader"; break; default: break; } os << std::endl; os << "// Language: " << getTargetLanguage() << std::endl; os << "// Created by Ogre RT Shader Generator. All rights reserved." << std::endl; os << "//-----------------------------------------------------------------------------" << std::endl; }
//----------------------------------------------------------------------- void CGProgramWriter::writeProgramDependencies(std::ostream& os, Program* program) { os << "//-----------------------------------------------------------------------------" << std::endl; os << "// PROGRAM DEPENDENCIES" << std::endl; os << "//-----------------------------------------------------------------------------" << std::endl; for (unsigned int i=0; i < program->getDependencyCount(); ++i) { const String& curDependency = program->getDependency(i); os << "#include " << '\"' << curDependency << "." << getTargetLanguage() << '\"' << std::endl; } }
//----------------------------------------------------------------------- void CGProgramWriter::writeAtomInstance(std::ostream& os, FunctionAtom* atom) { os << std::endl << "\t"; atom->writeSourceCode(os, getTargetLanguage()); os << std::endl; }