Last active
September 26, 2023 20:20
-
-
Save cauesmelo/a268ee763e4fefc35d27f5ac144b7bfc to your computer and use it in GitHub Desktop.
main.zig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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