5 #include "bundled_shaders.h"
12 // We need a fake (empty) list of shaders, since we reuse read_file().
13 BundledShader bundled_shaders[] = {
16 const char *shader_bundle = "";
17 extern string *movit_data_directory;
21 int main(int argc, char **argv)
23 std::vector<BundledShader> shaders;
26 movit_data_directory = new string(".");
28 for (int i = 1; i < argc; ++i) {
29 string contents = read_file(argv[i]);
30 shaders.push_back(BundledShader{ argv[i], /*offset=*/bundle.size(), /*length=*/contents.size() });
34 printf("// Autogenerated by make_bundled_shaders.cpp. Do not edit by hand!\n");
35 printf("#include <string>\n");
36 printf("#include \"bundled_shaders.h\"\n");
38 printf("namespace movit {\n");
40 printf("BundledShader bundled_shaders[] = {\n");
41 for (const BundledShader &shader : shaders) {
42 printf("\t{ \"%s\", %zu, %zu },\n", shader.filename, shader.offset, shader.length);
44 printf("\t{ nullptr, 0, 0 }\n");
46 printf("const char *shader_bundle = \"");
47 for (unsigned char ch : bundle) {
50 } else if (ch == '\t') {
52 } else if (ch == '"') {
54 } else if (ch == '\\') {
56 } else if (!isprint(ch)) {
64 printf("} // namespace movit\n");