Skip to content

Commit

Permalink
experiment: do not copy, build own
Browse files Browse the repository at this point in the history
  • Loading branch information
adamws committed Oct 27, 2024
1 parent 8e46027 commit c1f0922
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: mlugg/setup-zig@v1
with:
name: klawa
path: zig-out/bin
version: latest
- name: Install dependencies
shell: bash
run: |
sudo apt-get install ffmpeg xdotool xvfb \
libc6-dbg
sudo apt-get install libgl-dev libxi-dev \
libx11-dev xserver-xorg-dev xorg-dev \
ffmpeg xdotool xvfb \
libc6-dbg util-linux
- name: Install debug dependencies
shell: bash
run: |
sudo apt install ubuntu-dbgsym-keyring
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | \
sudo tee -a /etc/apt/sources.list.d/ddebs.list
sudo apt-get update
sudo apt-get install xserver-xorg-core-dbgsym libx11-6-dbgsym libxi6-dbgsym
- run: |
lscpu
zig build -Dcpu=znver3 -Dtarget=x86_64-native --verbose
- name: Run tests
shell: bash
run: |
chmod +x zig-out/bin/klawa
ldd zig-out/bin/klawa
cd tests && ./test.sh
- uses: actions/upload-artifact@v4
Expand Down
5 changes: 5 additions & 0 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ pub fn main() !void {
show_gui = !show_gui;
}

std.debug.print("Keys pop\n", .{});
if (keys.pop()) |k| {
std.debug.print("Consumed: '{s}'\n", .{k.symbol});

Expand All @@ -599,11 +600,13 @@ pub fn main() !void {
} else |_| {}
}

std.debug.print("Begin drawing\n", .{});
rl.beginDrawing();
rl.clearBackground(rl.Color.white);

const rot = rl.Vector2{ .x = 0, .y = 0 };

std.debug.print("Key states update\n", .{});
for (key_states) |k| {
rl.drawTexturePro(keycap_texture, k.src, k.dst, rot, k.angle, rl.Color.white);

Expand Down Expand Up @@ -679,10 +682,12 @@ pub fn main() !void {
if (debug) {
rl.drawFPS(10, 10);
}
std.debug.print("End drawing\n", .{});
rl.endDrawing();
tracy.frameMark();

if (res.args.render) |render_dir| {
std.debug.print("Start render\n", .{});
const rendering = tracy.traceNamed(@src(), "render");
defer rendering.end();

Expand Down

0 comments on commit c1f0922

Please sign in to comment.