Using SDL with Windows Subsystem for Linux

Viewed 2238

Using XMing I was able to run simple graphical applications on WSL such as gvim. Trying to run SDL2 applications doesn't work however. (SDL is unable to create the window). Is there a way to use SDL2 on WSL?

1 Answers

I use vcxsrv with WSL2 to run my SDL2 application. XMing worked for my on WSL1, but not WSL2. I have to uncheck native opengl and check disable access controls to get it to work. In WSL1 I had to export DISPLAY=:0 but in WSL2 I use export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0 for the DISPLAY environment variable.

Related