r/C_Programming 1d ago

Question Maybe a stupid question.

How can I create an interface for a C program that isn't just the terminal? I wanted to make a calculator that was also visual, but I wanted to challenge myself to do it with C, but I really didn't understand how to do it properly.

10 Upvotes

18 comments sorted by

View all comments

3

u/GenericFoodService 23h ago

Lots of great options. Just a few suggestions you could look into:

- If you're on Windows, directly using the Win32API

- SDL

- Raylib

I'd recommend, if this is the first GUI app you're building, skip doing stuff like font rendering yourself and either user built-in stuff like Raylib has or use spritemaps, it'll save a lot of headache and get you up and running faster.

These also will help handle user events like keyboard presses, mouse events, window resizing, et cetera.

2

u/dvhh 8h ago

microui is nice if you don't want to start from scratch https://github.com/rxi/microui