MCPcopy Create free account
hub / github.com/ddiakopoulos/polymer / preprocess_version

Function preprocess_version

libraries/lib-engine/src/shader.cpp:46–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46std::string preprocess_version(const std::string & source)
47{
48 std::stringstream input;
49 std::stringstream output;
50
51 input << source;
52
53 size_t lineNumber = 1;
54 std::string line;
55 std::string version;
56
57 while (std::getline(input, line))
58 {
59 if (line.find("#version") != std::string::npos) version = line;
60 else output << line << std::endl;
61 ++lineNumber;
62 }
63
64 std::stringstream result;
65 result << version << std::endl << output.str();
66 return result.str();
67}
68
69gl_shader preprocess(const std::string & vertexShader,
70 const std::string & fragmentShader,

Callers 1

preprocessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected