DEV Community

Avinash Pokhrel
Avinash Pokhrel

Posted on

From Pixels to Performance: GUI Clock in C !

Excited to share a side project I completed recently: a classic desktop clock GUI implemented entirely in C using two powerful graphics frameworks. This project was a great exercise in low-level, high-performance programming:

  1. SDL2 (Simple DirectMedia Layer): The C implementation focused on low-level control and graphics pipelines.

    Code

  2. Raylib: This C version prioritized simplicity and rapid development, leveraging its clean, immediate-mode drawing API for a highly performant and lightweight result.

    Code

Key takeaways from this project:

  1. Explored the trade-offs between low-level control (SDL2) and developer productivity (Raylib), all within the constraints of C.
  2. Gained experience in cross-platform compilation and dependency management, as reflected in the CI/CD pipeline developed for this project.
  3. Confirmed C's unmatched strength in creating lightweight, highly performant desktop applications.

Top comments (4)

Collapse
 
pauljlucas profile image
Paul J. Lucas

It's an app for a clock. High-performance doesn't matter. Updating the screen at 1 second intervals is slow by computer standards.

Collapse
 
xetri profile image
Avinash Pokhrel

Is there any better way, you could tell. I would love to know it.

Collapse
 
pauljlucas profile image
Paul J. Lucas

I didn't look at how you did it. My quibble is with you seemingly needing something highly performant. Applications that scan or process data in some way (grep, stock trading, etc.) need to be highly performant. Again, for something like a clock, performance simply doesn't matter.

Thread Thread
 
xetri profile image
Avinash Pokhrel

Thank you for your concern. I am just an Engineering student, trynna do better, day by day!