Skip to content

Instantly share code, notes, and snippets.

@cauesmelo
Last active September 26, 2023 20:20
Show Gist options
  • Select an option

  • Save cauesmelo/a268ee763e4fefc35d27f5ac144b7bfc to your computer and use it in GitHub Desktop.

Select an option

Save cauesmelo/a268ee763e4fefc35d27f5ac144b7bfc to your computer and use it in GitHub Desktop.
main.zig
const r = @cImport({
@cInclude("raylib.h");
});
const WINDOW_WIDTH = 960;
const WINDOW_HEIGHT = 540;
pub fn main() !void {
r.InitWindow(960, 540, "Zig Paint POC");
r.SetTargetFPS(60);
defer r.CloseWindow();
// The line above breaks build
var texture_target = r.LoadRenderTexture(WINDOW_WIDTH, WINDOW_HEIGHT);
// The line above works fine
var test_rtexture = r.ColorToInt(r.BLACK);
_ = test_rtexture;
r.ClearBackground(r.WHITE);
while (!r.WindowShouldClose()) {
r.BeginDrawing();
r.ClearBackground(r.WHITE);
r.EndDrawing();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment