First of all, I refactored the code into multiple file and used my own utilities library to make the code more maintenable, but also to avoid duplicating code and doing some dirty workaround. Now why did I do the whole project in a single file originally? Well it’s simple. Most of the projects I start, I waste to much time in trying to create the perfect architecture, perfect code and end up wasting more time in futility than in actual feature, making me lose all my motivation in no time. So I decided to go all in with feature only in mind. And it worked. I stayed motivated and achieve a first version I was satisfied with. Now does it mean that’s how I should always do it? Definitely not. But I need to find a nice balance between amazing clean code and feature code. That’s what I’ll be aiming for in the future and that’s the biggest thing I’m taking away from this.
After that, it was time to dwell into the code to add features and change a few things. So that’s what I did. Here’s a summary of the new things added:
- Added a text line that explains how to open the control window, embedding a FOSS Font(sansation).
- Limited the framerate to 60fps to reduce CPU consumption.
- Added possibility to load an image from inside the control window by giving a path. No more need to start the application again. On Microsoft Windows, you can get a file dialog.
- Can now save the modified image. It saves the new file at the same location of the previous file, but with a timestamp within the name.
- The colour change is now using a shader as originally wanted. Much more efficient. However that means only one colour at a time can be change. I’ll probably work on that soon.
- Can change background colour to distinguish better in case the image has a black background or has some black colours.
So as you can see, quite a few things in not a long time. I’ll keep you guys updated.
Until next time!