First day of coding
Today, I started this new project in C++ with PlatformIO to get more comfortable with it.
For now, it’s not really an OS, but we already have a Renderer class to handle rendering in an optimized way.
The goal
The goal is to create a complete desktop OS for ESP32 and various screens. Using an ESP32 allows network access, which is important on a computer in 2026.
I’d also like to run small video games on this OS, which I think would be quite an achievement.
I’m not trying to replace Windows or Linux XD, I just want to code a small retro system and have fun with it.
Rendering
So, this is what I worked on today, and I added a layer to the LovyanGFX library to have something optimized from the start.
When an object is displayed using the Renderer class, I save the intention to display a specific object with specific parameters in a list. Each object has a rectangle to detect collisions with other objects and therefore redraw the object or not.
When Renderer::render() is called, I check the areas to be displayed and only display what is necessary, which avoids flickering.
This method has several advantages, the main one being low RAM usage, which is crucial on a microcontroller like an ESP32.
The supported graphics are:
- Solid and non-solid rectangles
- Solid and non-solid rectangles with rounded corners
- Lines
- Circles
- Text
- Bitmap images or images without scaling
In my opinion, these are the essential elements for creating a good UI and complete video games (yes, really). In the videos, you can see the rendering of Mario (the NES version), even though there’s an issue with the colors, it’s definitely him. He’s present as a bitmap image in a C array.
Touchscreen
This is the second thing I implemented. The calibration isn’t perfect yet, but it’s already pretty good.
The touchscreen and stylus will allow for easy navigation of the OS without needing other peripherals, although I do plan to add joystick support to control the future mouse pointer.
What’s next?
Well, I’m not entirely sure. I’m thinking of creating UI components now, with the goal of building a window manager later on. But before that, I’ll probably code the foundations of the module that will handle inputs, to ensure an instant transition between touch and joystick. Anyway, I’ll keep doing a lot of graphics work!
Thanks so much for reading,
wilrakov, btw
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.