ROllerozxa

ROllerozxaRSS (Atom) feedGitHubMastodonYouTube

I'm a university student currently studying software engineering as well as an open source developer. You may know me as the project maintainer of Principia or for my contributions to Luanti (formerly Minetest).

This is my site where I write about what I do and about whatever else interests me, in the case that someone else finds it interesting.

Wanna read more about me or about what I do?

Latest blog posts

Screenshot of the main menu of Tensy, showing the text "Tensy" wiggling up and down in a sine wave pattern in front of a striped background. (The text rendering is done through what is brought up in the blog post)

Drawing text in the SDL renderer without SDL_ttf

1994 words

When you want to draw text in SDL, you would usually want to use SDL_ttf which in turn depends on Freetype for font rendering, giving you nice rendered fonts. But what if you do not want this? Maybe you just want some basic text rendering for a small game, and want not include the extra dependencies because something simpler would work just as well.

When I began working on a game written in C and using SDL, I wanted to try to implement my own font renderer rather than relying on SDL_ttf. What I wanted was just a way of drawing a pixelated monospace font, and it turns out to be quite simple to do so when you’re able to reduce the scope of the implementation. This blog post is a retelling of the process of doing just that.

Screenshot of the front page of principia-web.se, showing the navigation bar and the featured levels at the time of the screenshot.

The story of principia-web

3444 words

principia-web is two things: it is both an open source implementation of a Principia community site that can communicate with the client, and it is the name of the new Principia community site. While Principia is now an open source project with the source code being available for everyone to read and understand how things work, when I started working on principia-web in late 2019 this was far from the case.

Back then, it was still an abandoned proprietary game with little to nothing known about its internals, file formats or how it interfaced with the community site. The official community site had shut down in early 2018 and the remains of the community resided in a small Discord server, which I was a part of. But I was determined to take on this project, which I did not fully know the scope of at the time, and create a new website for the community to upload and share Principia levels.

Screenshot of Code - OSS showing some C code. The Visual Studio Code logo is shown to the right.

My C/C++ setup with Visual Studio Code (Code - OSS)

1140 words

Visual Studio Code is a code editor that has become quite popular since its introduction in 2016. Out of the box it is not necessarily an IDE, but because of the rich extension ecosystem you can compose together your own powerful IDE for any language you can think of.

This blog post goes over the current setup I have for doing C/C++ development in Visual Studio Code, the extensions and beyond.

The SDL logo with crudely drawn limbs and a face on it. It has angry eyebrows and it is running fast, as noted by the speed lines

SDL_LEAN_AND_MEAN

1040 words

As storage space becomes larger and larger even on the most modest of phones and bandwidth is becoming evermore plentiful, software tends to become larger in size over time as the necessity to optimise filesizes decreases. But there are also people who wish to reverse the trend by trying to conserve the amount of space their resulting program becomes through going closer to the metal or finding clever ways to cut down the size of their dependencies.

SDL is a library that aims to provide cross-platform low level access to input, audio, graphics and more that will just work across all supported platforms, for games and other multimedia programs. While the library originally had humble beginnings it has since grown with size as new features that while may be useful to some, are not something everyone would utilise when using SDL. Thankfully there are countless build options you can use to control what gets built with SDL but there is also the rather funnily named and undocumented define, by the name of SDL_LEAN_AND_MEAN.

Collage of logos for ccTLDs, from left to right: .cc, .ar, .me, .ml, .io, .tv, .gl, .co, .nu, .tk and .ai

Country Code TLDs and their unintended use cases

1795 words

Country Code TLDs (ccTLDs) are top level domains that are assigned to countries with names based on their ISO 3166 2-character country code. Their intended usecase are for regional, local sites or otherwise is tied to a country. But due to two-letter TLDs being reserved to ccTLDs, and there being fewer gTLDs in the past than there were now, a lot of effort has been put into repurposing ccTLDs, as well as creating clever domain hacks and short domains out of obscure but convenient country codes.

Many small countries have either struck digital gold with their country code, or been robbed of their space on the internet by opportunistic entrepreneurs who realised their worth far earlier than they did. This blog post goes over a list of the unintended use cases of ccTLDs, from specific domain hacks to full registry takeovers, but is by no means exhaustive.

Screenshot of terminal output from configuring SDL for crosscompiling using llvm-mingw. The LLVM logo and the MinGW-w64 logo is shown to the right.

Cross-compiling for Windows using llvm-mingw

1096 words

llvm-mingw is an LLVM-based MinGW-w64 toolchain distribution for compiling C/C++ programs for Windows. Prebuilt toolchains are provided as plain archives both for compiling natively on Windows, or for cross-compiling from Linux and macOS.

Compared to traditional MinGW-w64 based toolchains, it uses the Clang compiler as well as libc++, LLD and other LLVM projects in place of their GNU counterparts. With this it has support for compiling for Windows ARM targets and can target all four modern Windows architectures with one set of toolchain binaries.