I\'d like to declare GLSL shader strings inline using macro stringification:
#define STRINGIFY(A) #A
const GLchar* vert = STRINGIFY(
#version 120\\n
attribu
To achieve this purpose I used sed. I have seperate files with GLSL which I edit (with proper syntax highlighting), and in the same time GLSL in inlined in C++. Not very cross platform, but with msys it works under windows.
In C++ code:
const GLchar* vert =
#include "shader_processed.vert"
;
In Makefile:
shader_processed.vert: shader.vert
sed -f shader.sed shader.vert > shader_processed.vert
programm: shader_processed.vert main.cpp
g++ ...
shader.sed
s|\\|\\\\|g
s|"|\\"|g
s|$|\\n"|g
s|^|"|g