EGL fails to open display in toolbox

Hello, I was trying some OpenGL development using SDL on Silverblue, but it fails to initialize a window, responding with SDL error: Could not get EGL display. The EGL demos from the mesa-demos package also throw an initialization error, same with eglinfo from egl-utils. Vulkan and non-EGL demos seem to work fine.

This only happens in a toolbox, if running the SDL executable outside of one, it correctly initializes and displays a window. Answers to similar questions on the internet suggested installing the mesa-dri-drivers package, but it’s already installed in the toolbox, I’ve tried reinstalling it and other EGL libraries, to no effect.

Any ideas?