Symptoms of Living

learning C++ from scratch for desktop applications (and games)

Day 1, 26/06/25 - 11:02 AM

I got inspired again this morning and i want to go back to my learning windows GUI apps project once again. Like the last time i started by doing a research to acknowledge if it's worth it doing everything in bare C. The answer is yes, but it's a huge pain to handle everything by hand.

I decided that i can't go that far from now, because I am not a C master and I am afraid to introduce too many errors and security faults, so i drifted to Rust for a solution. I built some microservices with Rust in past, but i know that it's main purpose isn't for GUI programs.

are we gui yet

On the are we gui yet page i discovered that you can use Rust for GUI but it's not fully ready and tested yet. Going forward, I looked for Tauri as my GUI library, but I ended up discovering that it uses also Javascript and Node.js to work, as I am not a big fan of web development I immediately discarded that option.

Rolling back on the are we gui yet page i found an old "dear" friend: imgui as it has high-level Rust bindings to dear imgui. Awesome! Let's head to the documentation page. Just to find that it's like a fanmade porting of an indie and open source library that natively is not made for Rust. Since I am a perfectionist and a bit autistic I preferred to cut the edges and try to stick with the original dear imgui written in C++.

The problem is that I've never used C++ and i mostly programmed linux programs, so i just need to leard C++, Windows development and imgui. The plan is: head down, moving forward.

5:29 PM

Today's workday got a bit full, so i hadn't time for learning imgui, but i started following a video tutorial that helped me a lot on the basic configuration. I hate bloatwared setups, but on Windows using Visual Studio is mandatory, so let's install this 20GB boulder of IDE.


Official Day 1 of Coding, 04/07/25 - 3:24 PM

Things has changed from the "Day 1", this is the actual first day where I have already set up an environment and finally got into writing something that actually works.

SFML

I learned that a guide that brings you from zero doesn't exists, so I made my own path. At the moment I am using CodeBlocks on Windows 10 and I'm learning to use SFML for drawing things on the window. Yes I could choose a framework that has at least buttons and other basic things for making GUI programs, but I want to go as deep as possible and make things by my own, so SFML is basic enough.

What I have now is this "calculator" attempt that I'm working on:

calculator SFML

And to get a window with a button that turns green once pressed it took me all the morning. If someone wants to get a running environment I can save you hours of researches, just look at the official guide for MinGW and CodeBlocks and don't forget to add \SFML-3.0.0\bin to the PATH in your Environmental Variables.

I'm using SFML 3.0 and because of that a lot of tutorials of guides are deprecated as the methods and classes may change from previous versions, so be aware of that.

Next day to-do

From now I will keep updating this post as a developer diary, maybe in future I will divide it in pages or something like that, but I want to avoid making tons of different posts for this topic.

The next thing I want to do is making my custom classes for buttons and textboxes for a real calculator like the Windows one, by refactoring this project.


Day 2, 07/07/25 - 6:40 PM

Well, we are seeing a regression caused by my attitude of going into rabbit holes, the original idea was learning GUI programming in mid/high level programming languages, than it became with C++, after that i decided to master the basics of C++. Today i did another step back and headed for Beej C Guide, this time the excuse is that C is enough near the bare metal to understand everything i will ever need and do not do things without knowing why you are doing them.

c programming

I feel like a knight going through a long journey, he is tempted by stopping in the places he visits as the way becomes worse and more difficult. But he is still moving to see the end of the path and learn what the journey has in store for him.

#blog #programming