| 23 | } |
| 24 | |
| 25 | std::shared_ptr<VisualProgram> ProgramFactory::CreateFromFiles( |
| 26 | std::string const& vsFile, std::string const& psFile, |
| 27 | std::string const& gsFile) |
| 28 | { |
| 29 | LogAssert(vsFile != "" && psFile != "", |
| 30 | "A program must have a vertex shader and a pixel shader."); |
| 31 | |
| 32 | std::string vsSource = GetStringFromFile(vsFile); |
| 33 | LogAssert(vsSource != "", "Empty vertex shader source string."); |
| 34 | |
| 35 | std::string psSource = GetStringFromFile(psFile); |
| 36 | LogAssert(psSource != "", "Empty pixel shader source string."); |
| 37 | |
| 38 | std::string gsSource = ""; |
| 39 | if (gsFile != "") |
| 40 | { |
| 41 | gsSource = GetStringFromFile(gsFile); |
| 42 | LogAssert(gsSource != "", "Empty geometry shader source string."); |
| 43 | } |
| 44 | |
| 45 | return CreateFromNamedSources(vsFile, vsSource, psFile, psSource, gsFile, gsSource); |
| 46 | } |
| 47 | |
| 48 | std::shared_ptr<VisualProgram> ProgramFactory::CreateFromSources( |
| 49 | std::string const& vsSource, std::string const& psSource, |
no outgoing calls
no test coverage detected