An open API service indexing awesome lists of open source software.

https://github.com/slingercode/chafacad

AutoCAD... but chafa
https://github.com/slingercode/chafacad

raylib raylib-zig zig

Last synced: about 1 year ago
JSON representation

AutoCAD... but chafa

Awesome Lists containing this project

README

          

# ChafaCAD

## Requirements

- [Zig](https://ziglang.org/) => `>=0.13.0`
- [Raylib](https://www.raylib.com/) (raylib is handled by raylib-zig)

## Local Installation

1. `zig build`

> [!NOTE]
> I use the font [Berkeley Mono](https://berkeleygraphics.com/typefaces/berkeley-mono) (🐐) so the configuration expects this font

## TODO

* [ ] Hold esc key to quit draw mode if drawimg
* [ ] Draw a line, where and how to store it (deprecate line and store a polyline)
* [ ] Detect a figure (hatch mode in a polygon)
* [ ] Area
* [ ] Detect if the drawing is not a polygon
* [ ] 90° mode
* [ ] Combine hatch mode (two or more polygoms in a same operation)
* [ ] Two or more polygons inside a polygon?

## References

### Old References

This links are from my previos versions and I'm keeping them in
order to create an archive

#### Raylib using C

- [Raylib - Working on MacOS](https://github.com/raysan5/raylib/wiki/Working-on-macOS)
- [themutti - Raylib installation](https://github.com/themutti/raylib-installation)

#### OpenGL, GLEW, GLFW using C

This links are from my previous version that was using GLEW and GLFW but I'm keeping them in order to create an archive

- [Some interesting post in reddit](https://www.reddit.com/r/opengl/comments/199433i/how_can_i_setup_opengl_for_development_on_an_m2/?share_id=PtuJHyXrNGdZehrqYYZTM&utm_content=1&utm_medium=ios_app&utm_name=ioscss&utm_source=share&utm_term=1)
- [OpenGL tutorial](https://www.opengl-tutorial.org/)
- [Triangle](https://antongerdelan.net/opengl/hellotriangle.html)
- [Triangle solved](https://github.com/dmsurti/hello_triangle/blob/master/main.c)

## Personal comments

- I tried to build raylib manually in zig and failed miserably, as a possible TODO is to stop using raylib-zig in a near future (or not)
- Apparently, OpenGL in MacOS and the M lineup is kinda special.
So my option is this: use the last supported OpenGL version (4.1) with GLEW and use GLFW
- I spend like 1.5 hours trying to make the basic glfw example... there are some important
steps in order to link the library into the project. ([this is a nice help](https://stackoverflow.com/questions/60894143/linking-glew-and-glfw3-on-mac-on-command-line))

So... we need to link to the path that brew install it. in the build its the solution.