cgl is a compact, header-only C graphics library for 2D drawing operations using software rendering. Designed for simplicity and portability, cgl allows rendering of primitives such as lines, circles, triangles, and text to an in-memory framebuffer, which can then be displayed with any platform-dependent backend. It’s ideal for building custom engines, retro-style games, GUIs, or educational demos where GPU acceleration is not required. Its small footprint and lack of external dependencies make it easy to embed in any C project.

Features

  • Header-only C library for 2D software rendering
  • Draw lines, circles, rectangles, triangles, and text
  • Supports RGB color and transparency in rendering
  • Rasterization engine for triangle and shape filling
  • Blitting to custom framebuffers or SDL surfaces
  • No external dependencies or dynamic memory allocations
  • Font rendering using bitmap font system
  • Easy integration with existing C projects or engines
  • Platform-independent with customizable output methods

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow CGL

CGL Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of CGL!

Additional Project Details

Programming Language

C

Related Categories

C Libraries

Registered

2025-03-27