This commit is contained in:
nothke
2024-06-11 01:17:51 +02:00
parent a2f38877b6
commit 2135613c49
3 changed files with 4 additions and 69 deletions

View File

@@ -3,11 +3,6 @@ const std = @import("std");
const sokol = @import("sokol");
const sg = sokol.gfx;
const state = struct {
var bind: sg.Bindings = .{};
var pip: sg.Pipeline = .{};
};
var pass_action: sg.PassAction = .{};
export fn init() void {
@@ -27,13 +22,13 @@ export fn init() void {
}
fn timef() f32 {
return @as(f32, @floatCast(sokol.time.sec(sokol.time.now())));
return @floatCast(sokol.time.sec(sokol.time.now()));
}
export fn frame() void {
//std.log.info("{}", .{sokol.time.now()});
pass_action.colors[0].clear_value.g = @abs(@sin(timef()));
const col = &pass_action.colors[0].clear_value;
col.g = @abs(@sin(timef()));
col.r = @abs(@cos(timef()));
sg.beginPass(.{ .action = pass_action, .swapchain = sokol.glue.swapchain() });
sg.endPass();