Writing software to render images in OSMC

I wrote a program a while back using SFML to render and save a png image based on some metadata stored in a text file. I use this to generate a background image for a specific page in Kodi.

The way it’s set up at present, I open a folder on the Pi from Windows using an smb connection, set the contents of the metadata file, then run a batch file that runs the exe (overwriting the image) and deletes the image cache entry for that specific image so that Kodi will reload it.

That all works great, but since SFML is cross-platform, I’d really like to be able to compile the program for the Pi and just run it locally instead of having to do it from Windows. The problem that I’m running into is that I can install SFML and compile the program, but when I try to run it I get an error:

Failed to open X11 display; make sure the DISPLAY environment variable is set correctly

Asking around at the SFML forum I was told to build SFML with the SFML_USE_DRM flag, which I tried, but building the program and running it with that gives:

No drm device found!
Could not open drm device
Error initializing DRM
Segmentation fault

This seems to have something to do with access to the rendering engine, but I really don’t know anything about how all of that is implemented in Linux, or OSMC.

I’d greatly appreciate any advice on the matter.

(Link to relevant SFML forum post: Run SFML without a window for linux with no X11 installed)

We don’t have an X server by default. Ideally you’d want to render using GLES for video acceleration.

That was supposed to be the idea behind the DRM flag, but I don’t really know the details. I’ll throw together a short GLES project to see if I can build and run something from CLI.

Thank you!

Tinkering with GLES.
Is there a way to get a rendering context from OSMC?

Kodi uses GLES windowing, OSMC is the OS itself.