Skip to content

Commit

Permalink
use a regular sokol-shdc compiler glsl shader in the triangle example
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed May 16, 2024
1 parent fa8da6f commit 5ddfa9f
Show file tree
Hide file tree
Showing 4 changed files with 569 additions and 89 deletions.
1 change: 1 addition & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ fn buildShaders(b: *Build, target: Build.ResolvedTarget) void {
"texcube.glsl",
"blend.glsl",
"vertexpull.glsl",
"triangle.glsl",
};
const optional_shdc: ?[:0]const u8 = comptime switch (builtin.os.tag) {
.windows => "win32/sokol-shdc.exe",
Expand Down
22 changes: 22 additions & 0 deletions src/examples/shaders/triangle.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@vs vs
in vec4 position;
in vec4 color0;

out vec4 color;

void main() {
gl_Position = position;
color = color0;
}
@end

@fs fs
in vec4 color;
out vec4 frag_color;

void main() {
frag_color = color;
}
@end

@program triangle vs fs
Loading

0 comments on commit 5ddfa9f

Please sign in to comment.