title: OpenGL / GLSL - using glShaderSource with multiple source to support include files
body: <p>Since GLSL doesn't have an include-file option I'm trying to add this by using a "#pragma include" parser.  (I want this because I have some generic methods I'd like to implement only once but might use in many different shaders, like Ken Perlin's smootherstep)</p>
  
  <p>Parsing the shader files to get the included files works fine.
  But when setting the ShaderSource with the multiple source files I always run into problems; since my main shader normally starts with "#version 330" and the #version-line always has to be the first line in the shader, I can only add my main file as the first in the array of strings passed to glShadersource, and after that all the included files.
  But then my main file can't use any functions implemented in those included files, since they'll essentially be concatenated <em>after</em> my main file so the compiler complains that it doesn't know the functions my main file is using.</p>
  
  <p>The only way I can think of to get it to work is to read the main file, parse the include pragma, and then <em>replace</em> that pragma line with the file-contents of the file to be included (recursively applying this same method to all included files that might include other files themselves) - but that would mean the linenumbers in compilation-errors would not match the real linenumbers of the main file anymore.</p>
  
  <p>Has anybody set up some sort of "include" functionality for GLSL that works AND keeps the linenumbers ? And if so - how ?</p>