MCPcopy Create free account
hub / github.com/Hopson97/HopsonCraft / getSource

Function getSource

Source/Shaders/Shader_Loader.cpp:30–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 }
29
30 std::string getSource(const std::string& sourceFile, const std::string& type)
31 {
32 std::ifstream inFile ("Data/Shaders/" + sourceFile + "_" + type + ".glsl");
33 std::string source;
34 std::stringstream stringStream;
35
36 if (!inFile.is_open())
37 {
38 throw std::runtime_error ("Could not open shader file: " + sourceFile);
39 }
40
41 stringStream << inFile.rdbuf();
42 source = stringStream.str();
43
44 return source;
45 }
46
47 GLuint createProgram(GLuint vertexShaderID, GLuint fragmentShaderID)
48 {

Callers 1

loadShaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected