In my spare time I am working on Lazarus port of originally Delphi game called C-evo (
https://app.zdechov.net/c-evo/) It is not "production" ready yet but it is playable. One of the problems which I still need to solve is high DPI support. Now everybody has big screen with Full HD or better resolution. Under Windows OS it is possible to let the game run in original DPI and OS will take care of up-scaling. But it simply doesn't look sharp and under Linux there isn't such option and graphics and text under Linux looks kind of messy. So you can say, just add high DPI support and the problem solved. But how to do that? Simply without much change of source code? Code base for the game is pretty huge and original author used a lot of constants for custom drawing. So to scale all these variables and numeric constants is really huge task and it would make the code much bigger and lot less readable. It would take weeks to modify and test all that code.
If I would use Delphi and VCL then the logical choice would be to convert the game to use FMX which has DPI independent coordinate system. Also as a bonus I would be able to build the game for Android and iOS. But if I need to stick with Lazarus then I need to use just LCL which is basically equivalent to VCL. And it wasn't designed for high DPI support from the start so it's high DPI support was added later and it is pretty hard to use for big projects.
I am not aware of any nice complete game with fully custom graphics written in Lazarus/FPC. Or even such game with high DPI support which is nowadays must have. So I can't simply look into source code of other such project to learn from an example.
So if you have any tips and suggestions how to proceed effectively with such task, please write them down. They may be useful for other developers as well.
Direct link to source code: https:/svn.zdechov.net/c-evo/trunk/ (if somebody would like to try on his/her own)
High DPI wiki article:
https://wiki.freepascal.org/High_DPI