From 50089bf9969edb5f10ff552b90620a4882e3c474 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 20 Feb 2021 13:38:38 +0000 Subject: m4 based GLSL embedding Passes a lint check, less mangling, more automation --- utility/embed-glsl.cpp.m4 | 10 ++++++++++ utility/embed-glsl.h.m4 | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 utility/embed-glsl.cpp.m4 create mode 100644 utility/embed-glsl.h.m4 (limited to 'utility') diff --git a/utility/embed-glsl.cpp.m4 b/utility/embed-glsl.cpp.m4 new file mode 100644 index 0000000..febba68 --- /dev/null +++ b/utility/embed-glsl.cpp.m4 @@ -0,0 +1,10 @@ +changecom()dnl +// NAME +#include "substr(TYPE,1)-NAME.h" +#include + +constexpr const GLchar * src { R"GLSL-EMBED(dnl +include(SOURCE))GLSL-EMBED" }; +constexpr auto len { constexpr_strlen (src) }; + +const GLsource NAME`_'substr(TYPE,1) { src, len, GLTYPE }; diff --git a/utility/embed-glsl.h.m4 b/utility/embed-glsl.h.m4 new file mode 100644 index 0000000..918007b --- /dev/null +++ b/utility/embed-glsl.h.m4 @@ -0,0 +1,4 @@ +// NAME +#include + +extern const GLsource NAME`_'substr(TYPE,1); -- cgit v1.2.3