بدون توضیح

刘策 516e5e84b5 Init HelloWorld! 11 ماه پیش
assets 516e5e84b5 Init HelloWorld! 11 ماه پیش
src 516e5e84b5 Init HelloWorld! 11 ماه پیش
.gitignore 09ca1e2dfd add ignore 11 ماه پیش
Readme.md 516e5e84b5 Init HelloWorld! 11 ماه پیش
build.zig 516e5e84b5 Init HelloWorld! 11 ماه پیش
build.zig.zon 516e5e84b5 Init HelloWorld! 11 ماه پیش
newbuild.zig 516e5e84b5 Init HelloWorld! 11 ماه پیش

Readme.md

Readme.md

drawing_app/
├── src/
│   ├── main.zig          // 主程序入口
│   ├── canvas.zig        // 画布逻辑
│   ├── tools.zig         // 绘图工具(画笔、橡皮擦等)
│   ├── ui.zig            // UI 组件(颜色选择、工具栏等)
│   └── utils.zig         // 通用工具函数
├── build.zig             // Zig 构建文件
├── assets/               // 静态资源(如图标、默认画布等)
│   └── icon.png
└── README.md


Drawing App

A simple drawing application built with Zig and SDL2, inspired by Windows Paint and Photoshop.

Features

  • Basic brush and eraser tools
  • Adjustable brush size
  • Color selection (R/G/B)
  • Canvas rendering with SDL2

Requirements

  • Zig compiler (0.13.0 or later)
  • SDL2 and SDL2_ttf libraries
  • A TTF font file in assets/font.ttf (e.g., download from Google Fonts)

Build and Run

  1. Install dependencies (see Requirements).
  2. Run zig build run in the project directory.

Controls

  • Left Mouse: Draw with selected tool
  • B: Select Brush
  • E: Select Eraser
  • +/-: Adjust brush size
  • R/G/B: Change color to Red/Green/Blue

Future Improvements

  • Save/load canvas
  • Undo/redo
  • Layers
  • Advanced tools (e.g., selection, fill)