MCPcopy Create free account
hub / github.com/arrayfire/forge / print_usage

Function print_usage

CMakeModules/glsl2cpp.cpp:19–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17typedef map<string, string> opt_t;
18
19static
20void print_usage() {
21 cout << R"delimiter(GLSL2CPP
22Converts OpenGL shader files to C++ headers. It is similar to bin2c and xxd but adds
23support for namespaces.
24
25| --name | name of the variable (default: var) |
26| --file | input file |
27| --output | output file (If no output is specified then it prints to stdout) |
28| --type | Type of variable (default: char) |
29| --namespace | A space seperated list of namespaces |
30| --formatted | Tabs for formatting |
31| --version | Prints my name |
32| --help | Prints usage info |
33
34Example
35-------
36Command:
37./glsl2cpp --file blah.txt --namespace shaders --formatted --name image_vs
38
39Will produce the following:
40#pragma once
41#include <cstddef>
42namespace shaders {
43 static const char image_vs[] = R"shader(
44#version 330
45
46layout(location = 0) in vec3 pos;
47layout(location = 1) in vec2 tex;
48
49uniform mat4 matrix;
50
51out vec2 texcoord;
52
53void main() {
54 texcoord = tex;
55 gl_Position = matrix * vec4(pos,1.0);
56}
57 )shader";
58}
59)delimiter";
60 exit(0);
61}
62
63static bool formatted;
64

Callers 1

parse_optionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected