Browse Source

Properly number shader sources.

Previously the sources were numbered 1, 3, 5 etc., which is wrong.
pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
9d1d4b5ef1
  1. 2
      src/Shader.cpp

2
src/Shader.cpp

@ -103,7 +103,7 @@ Shader& Shader::addSource(std::string source) {
if(!source.empty()) {
/* Fix line numbers, so line 41 of third added file is marked as 3(41).
Source 0 is the #version string added in constructor. */
sources.push_back("#line 1 " + std::to_string(sources.size()) + '\n');
sources.push_back("#line 1 " + std::to_string((sources.size()+1)/2) + '\n');
sources.push_back(std::move(source));
}

Loading…
Cancel
Save