From: Brendan Hansen Date: Sun, 19 Dec 2021 04:42:32 +0000 (-0600) Subject: color cubes and vsync X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=1a36454a8decdab356c3312bdccd04ac8190b9c5;p=voxel-shooter.git color cubes and vsync --- diff --git a/src/main.onyx b/src/main.onyx index 37ba4f4..b3146b0 100644 --- a/src/main.onyx +++ b/src/main.onyx @@ -14,7 +14,7 @@ create_window :: () => { window = glfwCreateWindow(1200, 720, #cstr "Voxel Shooter"); glfwMakeContextCurrent(window); - glfwSwapInterval(0); + glfwSwapInterval(1); glfwSetWindowSizeCallback(window, "on_resize"); glfwSetKeyCallback(window, "on_key"); } @@ -124,7 +124,7 @@ setup_opengl :: () { } for z: 32 do for x: 32 { if random.between(0, 10) >= 7 do continue; - chunk_set(chunk, x, 1, z, block_make(0.6, 0.6, 0.6, 0.8)); + chunk_set(chunk, x, 1, z, block_make(random.float(0, 1), random.float(0, 1), random.float(0, 1), 1)); } chunk.mesh = chunk_build_mesh(chunk);