Get and set frame rate
This commit is contained in:
@ -1,17 +1,18 @@
|
||||
const std = @import("std");
|
||||
|
||||
const minifb = @import("minifb");
|
||||
const mfb = @import("minifb");
|
||||
|
||||
const Width = 800;
|
||||
const Height = 600;
|
||||
|
||||
fn grey(value: u8) u32 {
|
||||
return minifb.rgb(value, value, value);
|
||||
return mfb.rgb(value, value, value);
|
||||
}
|
||||
|
||||
pub fn main() anyerror!void {
|
||||
std.log.info("All your codebase are belong to us.", .{});
|
||||
var win = minifb.Window.open("Hello minifb-zig", Width, Height) catch unreachable;
|
||||
var win = mfb.Window.open("Hello minifb-zig", Width, Height) catch unreachable;
|
||||
mfb.setTargetFPS(60);
|
||||
|
||||
var color: u32 = grey(0);
|
||||
const deltaColor = grey(1);
|
||||
@ -37,7 +38,7 @@ pub fn main() anyerror!void {
|
||||
std.mem.set(u32, buffer, color);
|
||||
var i: u32 = 0;
|
||||
while (i < Width) {
|
||||
buffer[i] = minifb.rgb(255,0,0);
|
||||
buffer[i] = mfb.rgb(255,0,0);
|
||||
i += 1;
|
||||
}
|
||||
_ = win.update(buffer) catch unreachable;
|
||||
|
Reference in New Issue
Block a user