aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2025-03-16 20:49:57 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-16 20:49:57 +0000
commita4a4b2d3d3cc026aedeeef9241b894dff2d3684d (patch)
tree3d9527d050f003d646b1a6da9c6300f4310ff504 /src
parentdefault output size to render size (diff)
downloadglsl-view-a4a4b2d3d3cc026aedeeef9241b894dff2d3684d.tar.gz
glsl-view-a4a4b2d3d3cc026aedeeef9241b894dff2d3684d.zip
enable transparent framebuffer
Diffstat (limited to 'src')
-rw-r--r--src/main.zig3
-rw-r--r--src/output.zig6
2 files changed, 8 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig
index 11052e5..eb7aef2 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -97,7 +97,8 @@ pub fn main() !void {
\\out vec4 color;
\\
\\void main() {
- \\ color = vec4(0,0,0,1);
+ \\ vec2 check = floor(uv*10);
+ \\ color = vec4(vec3(mod(check.x+check.y, 2.0)), 1);
\\}
);
defer main_program.destroy();
diff --git a/src/output.zig b/src/output.zig
index 6eea72e..593caac 100644
--- a/src/output.zig
+++ b/src/output.zig
@@ -138,6 +138,9 @@ pub const WindowOutput = struct {
const self = allocator.create(WindowOutput) catch unreachable;
c.glfwDefaultWindowHints();
+ c.glfwWindowHint(c.GLFW_FOCUSED, c.GLFW_FALSE);
+ c.glfwWindowHint(c.GLFW_FLOATING, c.GLFW_TRUE);
+ c.glfwWindowHint(c.GLFW_TRANSPARENT_FRAMEBUFFER, c.GL_TRUE);
self.* = .{
.constants = constants,
@@ -173,7 +176,10 @@ pub const WindowOutput = struct {
return true;
c.glfwMakeContextCurrent(self.window);
+ c.glClearColor(0, 0, 0, 1);
c.glClear(c.GL_COLOR_BUFFER_BIT);
+ c.glfwWindowHint(c.GLFW_RESIZABLE, c.GLFW_FALSE);
+ c.glfwWindowHint(c.GLFW_DECORATED, c.GLFW_FALSE);
if (self.resized) {
var width: c_int = undefined;