Cleanup
This commit is contained in:
13
src/main.zig
13
src/main.zig
@@ -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();
|
||||
|
Reference in New Issue
Block a user