libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.76k stars 1.81k forks source link

No available video device - Any way to use the library on headless ubuntu server? #9410

Closed slunak closed 6 months ago

slunak commented 6 months ago

Hello folks.

Is there any way to use the library on a Ubuntu Server without a display?

if err := sdl.Init(sdl.INIT_VIDEO); err != nil {
    println(err.Error())
    return
}

Gives the following error: No available video device, which is expected.

The reason I would like to use the library on headless ubuntu is to only generate graphics with SDL and later simply copy it to LED matrix display, pixel by pixel.

icculus commented 6 months ago

Set the environment variable SDL_VIDEODRIVER=dummy

(It's SDL_VIDEO_DRIVER in SDL3.)

slunak commented 6 months ago

Does it apply to SDL2? I'm afraid Go binding currently supports only version 2.

icculus commented 6 months ago

Yes. One less underscore in the variable name.

slunak commented 6 months ago

Sorry, I missed to see the difference between the two vars in your first reply; it was either late last night or perhaps because I was looking at it from my mobile phone :) in any case, thank you very much. Feel free to close this issue.