cginternals / globjects

C++ library strictly wrapping OpenGL objects.
https://globjects.org
MIT License
538 stars 59 forks source link

Allow text mode for files and read shaders in text mode #281

Closed j-o closed 9 years ago

j-o commented 9 years ago

... because processing shaders read in binary mode on Windows is rather annoying, as they contain \r\n line endings (possibly mixed with pure \n).

scheibel commented 9 years ago

Why is reading binary shader files on windows annoying? Is one line ending count twice? Is the default type for open files always text?

j-o commented 9 years ago

Yes, the extra \rs appear in strings then and must be taken into account. The convention for C++ is to work with pure \ns internally on all platforms and let iostreams in text mode deal with platforms specific stuff. Do you mean default in globjects (no) or the std library (yes)?

scheibel commented 9 years ago

I meant in the STL, thanks for the clarification.