A 7-segment digital clock rendered from scratch in C using raylib.
- Custom 7-segment display drawn using
DrawTriangleStrip - Hours : Minutes : Seconds (HH:MM:SS) in local time
- Red segments on a pure black background
- Centered layout with proper spacing between time groups
- Runs at a smooth 60 FPS
- macOS (build uses Apple frameworks)
- raylib (installed via Homebrew)
pkg-configclang(Xcode Command Line Tools)
Install raylib:
brew install raylibmake build # compiles the binary
make run # builds and launches the clock
make clean # removes the binary- Each digit is composed of up to 7 segments defined in a lookup table.
- Segments are drawn as 6-point triangle strips (both horizontal and vertical variants).
- Colons are rendered as two simple circles between the hour/minute and minute/second groups.
- Time is fetched using standard C
time()+localtime(). - The display is recalculated and redrawn every frame.
