From 80de6db167484ec2fe4b018209b1e97ad1802361 Mon Sep 17 00:00:00 2001 From: Nathan Christopher McRae Date: Sat, 10 Jun 2023 22:13:40 -0700 Subject: [PATCH] Added red mark at end of long line --- src/main.zig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main.zig b/src/main.zig index 6b4f926..533c4b9 100644 --- a/src/main.zig +++ b/src/main.zig @@ -110,6 +110,32 @@ pub fn main() !void { c.SDL_Log("Unable to draw point: %d", draw_result); return error.SDLDrawingFailed; } + } else { + const red_color_result = c.SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); + if (red_color_result != 0) { + c.SDL_Log("Unable to set draw color: %d", red_color_result); + return error.SDLInitializationFailed; + } + + const draw_result = c.SDL_RenderDrawPoint(renderer, (column + 1) * column_width - 1, y); + if (draw_result != 0) { + c.SDL_Log("Unable to draw point: %d", draw_result); + return error.SDLDrawingFailed; + } + + if (!color) { + const white_color_result = c.SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); + if (white_color_result != 0) { + c.SDL_Log("Unable to set draw color: %d", white_color_result); + return error.SDLInitializationFailed; + } + } else { + const black_color_result = c.SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + if (black_color_result != 0) { + c.SDL_Log("Unable to set draw color: %d", black_color_result); + return error.SDLInitializationFailed; + } + } } x += 1;