36 lines
796 B
Plaintext
36 lines
796 B
Plaintext
// To see what the result of parsing this file looks like, copy the code and
|
|
// paste it into the editor at https://flecs.dev/explorer
|
|
//
|
|
// To load this file yourself, call ecs_plecs_from_file("strings.flecs");
|
|
|
|
// Plecs component values can be populated with strings. To see how this works,
|
|
// we first need to create a component type (see reflection example).
|
|
using flecs.meta
|
|
|
|
Struct Shader {
|
|
filename :- {string}
|
|
code :- {string}
|
|
}
|
|
|
|
// Create component values with strings
|
|
my_pipeline {
|
|
- (Shader, Vertex) {
|
|
// Normal string
|
|
filename: "vert.glsl",
|
|
|
|
// Multiline string
|
|
code: `
|
|
void main() {
|
|
gl_Position = pos;
|
|
}`
|
|
}
|
|
|
|
- (Shader, Fragment) {
|
|
filename: "frag.glsl",
|
|
code: `
|
|
void main() {
|
|
frag_color = color;
|
|
}`
|
|
}
|
|
}
|