diff --git a/src/WallpaperEngine/Render/Shaders/Compiler.cpp b/src/WallpaperEngine/Render/Shaders/Compiler.cpp index 68daa79..2b0a4b6 100644 --- a/src/WallpaperEngine/Render/Shaders/Compiler.cpp +++ b/src/WallpaperEngine/Render/Shaders/Compiler.cpp @@ -265,11 +265,20 @@ namespace WallpaperEngine::Render::Shaders // extract value between quotes filename = this->extractQuotedValue (it); BREAK_IF_ERROR - // load the content to the includes contents and continue with the next one - // try to find the file first - this->m_includesContent += "// begin of included from file " + filename + "\r\n"; - this->m_includesContent += this->lookupShaderFile (filename); - this->m_includesContent += "\r\n// end of included from file " + filename + "\r\n"; + if (this->m_content.find (" main(") == std::string::npos && this->m_content.find (" main (") == std::string::npos) + { + this->m_compiledContent += "// begin of include from file " + filename + "\r\n"; + this->m_compiledContent += this->lookupShaderFile (filename); + this->m_compiledContent += "\r\n// end of included from file " + filename + "\r\n"; + } + else + { + // load the content to the includes contents and continue with the next one + // try to find the file first + this->m_includesContent += "// begin of included from file " + filename + "\r\n"; + this->m_includesContent += this->lookupShaderFile (filename); + this->m_includesContent += "\r\n// end of included from file " + filename + "\r\n"; + } } else {