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;