mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 22:43:39 +00:00
Tick agnes before drawing each screen, but no faster.
This commit is contained in:
parent
035608b04a
commit
4741900562
1 changed files with 20 additions and 16 deletions
|
|
@ -75,6 +75,11 @@ fn submain() !void {
|
||||||
agnes.agnes_set_input(ag, &ag_input, 0);
|
agnes.agnes_set_input(ag, &ag_input, 0);
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
|
checkKeys();
|
||||||
|
var new_frame:bool = false;
|
||||||
|
_ = agnes.agnes_tick(ag, &new_frame);
|
||||||
|
|
||||||
|
if (new_frame) {
|
||||||
if (!agnes.agnes_next_frame(ag)) {
|
if (!agnes.agnes_next_frame(ag)) {
|
||||||
try console.print("Next frame failed!\n", .{});
|
try console.print("Next frame failed!\n", .{});
|
||||||
try console.flush();
|
try console.flush();
|
||||||
|
|
@ -90,11 +95,10 @@ fn submain() !void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkKeys();
|
|
||||||
|
|
||||||
uvm.render(@ptrCast(&gfxFramebuffer), WIDTH * HEIGHT * 4);
|
uvm.render(@ptrCast(&gfxFramebuffer), WIDTH * HEIGHT * 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export fn main() void {
|
export fn main() void {
|
||||||
_ = submain() catch {
|
_ = submain() catch {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue