Flashy green

This commit is contained in:
nothke 2024-06-09 19:56:09 +02:00
parent 7088c43ac2
commit a2f38877b6

View File

@ -16,16 +16,24 @@ export fn init() void {
.environment = sokol.glue.environment(),
});
sokol.time.setup();
pass_action.colors[0] = .{
.load_action = .CLEAR,
.clear_value = .{ .r = 0.2, .g = 1, .b = 1, .a = 1 },
.clear_value = .{ .r = 0, .g = 1, .b = 0, .a = 1 },
};
std.debug.print("Backend: {}\n", .{sg.queryBackend()});
std.log.info("Backend: {}\n", .{sg.queryBackend()});
}
fn timef() f32 {
return @as(f32, @floatCast(sokol.time.sec(sokol.time.now())));
}
export fn frame() void {
//const g = pass_action.colors[0].clear_value.g + 0.01;
//std.log.info("{}", .{sokol.time.now()});
pass_action.colors[0].clear_value.g = @abs(@sin(timef()));
sg.beginPass(.{ .action = pass_action, .swapchain = sokol.glue.swapchain() });
sg.endPass();