Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • This is mostly for streamlining SSCCE programs/examples here on SO so in the interests of portability I'd like to avoid C++11. Commented Dec 14, 2012 at 5:03
  • 8
    Excellent suggestion. GLSL shaders and OpenCL kernels are one of the best use-cases for raw string literals. But note, that the delimiter is not strictly neccessary, it can just be empty, only the R"()" is mandatory. Commented Dec 14, 2012 at 8:50
  • @ChristianRau You're right. I only need the END to escape a literal )" not just ). Commented Dec 14, 2012 at 12:21
  • 1
    @genpfault Or just start out with const GLchar* vert = R"END(#version 120 without the newline. I just wrote my answer that way to make it look nicer. (To me). Commented Feb 19, 2019 at 23:01
  • 1
    @genpfault: Sounds like they're not following the spec closely, as it says: "The #version directive must occur in a shader before anything else, except for comments and white space.", and newlines are whitespace. Commented Sep 23, 2019 at 17:50