Piero V.

Customize NSIS MUI2's welcome page

Recently, I had to customize NSIS installers for work.

It was my first time, and I had to get to know this tool first. While this system already offers many functionalities, if you want to change anything in its built-in pages, you must rely on Win32 APIs.

The welcome and finish pages are an exception, up to a certain sense, because they are made with nsDialogs, NSIS’s plugin for creating completely custom pages.

As a result, it is possible to pass to add new widgets using the same API in a function passed MUI_PAGE_CUSTOMFUNCTION_SHOW. However, I encountered a major problem: the default widgets fill the available space. Therefore, any new widgets will be hidden, and it will not be possible to interact with them with the mouse. I looked for a solution online - NSIS is more than 20 years old, so you can find a lot of documentation - but I did not find an answer that worked for me.

Eventually, I found that you can resize widgets on Win32 with MoveWindow. … [Leggi il resto]

I have become a professional FOSS developer

I had the luck to get to know free and open source software when I was still a kid. In this way, the willingness to share my knowledge became a part of my culture and personality.

If you browse this site, you will see that I have shared a lot of small projects, like FlatPress plugins. However, I have never been a long-time contributor to a big project.

Moreover, at the end of my University course of study, I had to do an internship to graduate. I went to a software company that creates proprietary programs for the enterprise. I remained for six months and then was hired as an employee, and I stayed for another two years.

I was on a small team developing a CAD, and I enjoyed working with my coworkers a lot (even though I worked remotely for most of the two years because of COVID).

But I did not like using proprietary libraries.

One of them was Parasolid, a geometry kernel developed by Siemens. It is powerful, but some functions are overly complicated to use. It comes with very prolific documentation, and its subscription includes technical support. But it is the only way to troubleshoot your problems: I could never find any public information online, which is extremely surprising in the 2020s! … [Leggi il resto]

Back to Rust again

In 2010 I tried to program a video game with a friend for the first time. And it was our first time with C++, too. Of course, it was C++2003 since C++11 was the new-not-yet-stable thing.

I must say that our approach was quite naive. For example, we thought we would always play the game on a LAN. Thus, we never worried about lag compensation.

Now, a few years have passed, and I have learned a thing or two, even though I still have to finish a game project.

So, at the beginning of this year, this friend pushed me to learn Rust, and I decided to learn it through game development again.

At a certain point, I decided to use a physics engine, and I found Rapier. I was especially interested in its determinism to finally implement a lag compensation mechanism. But I did not understand how to use it correctly. Only recently, I understood it favors an approach similar to functional programming, whereas I was trying an OOP-like approach. This also led to fights with the borrow checker. So, because of these problems and my usual decrease in interest and focus, I left yet another project incomplete. … [Leggi il resto]

VBO multipli con OpenGL ES 2.0

Emscripten e WebAssembly

Di recente ho iniziato un nuovo progettino, per il quale sto usando SDL e OpenGL ES 2.0.

Durante il lockdown, avevo imparato a fare qualcosa di base con OpenGL 3.3, e avevo usato sempre SDL e un po’ Bullet, ma poi avevo lasciato stare il tutto. Adesso ho ricominciato, ma con OpenGL ES 2.0 perché offre una possibilità molto interessante: con Emscripten, si può compilare il progetto per WebAssembly, e GLES 2.0 viene trasformato direttamente in WebGL.

Pur non essendo più molto appassionato di sviluppo web, questa cosa mi attrae particolarmente. Innanzitutto, pubblicando sul web si possono raggiungere più persone, anche per il solo fatto che aspettare qualche secondo che si carichi una pagina è molto meno impegnativo che far scaricare uno zip, decompattarlo, e far avviare il programma. E non parliamo nemmeno degli installanti…

Il codice può essere sviluppato praticamente in qualsiasi linguaggio (C, C++, o qualcosa che abbia un interprete/una VM scritta in questi linguaggi), ma poi si può interfacciare al JavaScript che gira nel browser. Questo vuol dire che potrei fare le parti di rendering 3D in C++, ma le parti di UI in HTML, CSS e JavaScript. Le ultime volte che ho provato a fare qualcosa in JS mi sono stufato subito, però, per fare UI, lo stack web ha pochi eguali. … [Leggi il resto]

A dynamic character controller for Bullet?

Or, how I tried to create a dynamic character controller for Bullet, but eventually (almost?) gave up.


I like spending some time using the Bullet physics library, I already wrote some articles about my experiments with it. This time, I wanted to create a custom character controller.

Bullet alread provides a (kinematic) character controller, but in general it is not regarded as a good one. I also tried to study a bit its code, but, in my opinion, it adds many complications without reason, and even something like managing in the correct way the velocity is a big problem with it. Indeed, Erwin Coumans himself (the main Bullet developer) said that btKinematicCharacterController is not supported anymore.

Therefore I decided to write my own one.

There are two kinds of character controller: kinematic ones and dynamic ones.

The former use the Physics engine, if any, just for collisions, and compute all the movements by themselves. This was the only way at the beginning of the video games, since there was not any Physics engine at all, but only some code for specific purposes. … [Leggi il resto]