سؤال

I'm doing some shader programming in D, and what I want to do is write my shaders in text files, but during compilation have the text files be put into the executable / library, just like a normal string would.

Is there a way to do this in D?

هل كانت مفيدة؟

المحلول

You can use Import Expressions.

string shaderText = import("shader.txt");

Make sure you use the -J compiler switch to supply the directory of the shader.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top