mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-23 05:10:17 +00:00
use waiting rather than polling on window
This commit is contained in:
13
src/main.zig
13
src/main.zig
@@ -2,9 +2,20 @@ const std = @import("std");
|
||||
const c = @import("c.zig");
|
||||
|
||||
pub fn main() !void {
|
||||
// Set the window as resizable. This is particularly important for
|
||||
// tiling window managers such as i3 since if they are not resizable they
|
||||
// usually default to floating and we do not want to float by default!
|
||||
c.SetConfigFlags(c.FLAG_WINDOW_RESIZABLE | c.FLAG_VSYNC_HINT);
|
||||
|
||||
// Create our window
|
||||
c.InitWindow(640, 480, "ghostty");
|
||||
c.SetTargetFPS(60);
|
||||
defer c.CloseWindow();
|
||||
|
||||
while (!c.WindowShouldClose()) {}
|
||||
// Draw
|
||||
while (!c.WindowShouldClose()) {
|
||||
c.BeginDrawing();
|
||||
c.ClearBackground(c.BLACK);
|
||||
c.EndDrawing();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user