hi,
I’m porting an app to StarFive VisionFive2 RISC-V @64bit Linux.
Compile work well, but once run, the app quit without creating any window.
Current init is as so:
SDL_Init(SDL_INIT_VIDEO);
and the error shown is:
SDL_Init Error: wayland not available
WL: ERROR initializing graphic system. Program aborted.
I tryed to change the init to:
SDL_Init(0);
and the error shown is:
SDL_CreateWindow Error: wayland not available
WL: ERROR initializing graphic system. Program aborted.
In the second case the error happen on
winPtr = SDL_CreateWindow(“Wilderland - A Hobbit Environment”, 40, 24, MAINWINWIDTH, MAINWINHEIGHT, WinMode | SDL_WINDOW_HIDDEN|SDL_WINDOW_ALLOW_HIGHDPI);
WinMode can be either 0, SDL_WINDOW_FULLSCREEN or SDL_WINDOW_FULLSCREEN_DESKTOP
Maybe you is just trying without a X11 window or wayland?
Here in my Xubuntu I use SDL2 just with X11.
Before SDL2 the SDL1.2 runs onframebuffer, but it appears was abandoned the support to framebuffer (which able any sdl1.2 app can run without wayland or x11).
as Windows Manager I use LightDM, while as Desktop Manager I use GNOME. Then I open a Terminal and launch the app.
Other Apps like Xeyes work, so DISPLAY is defined and X is available, I do not know if Wayland is already implemented on RISC-V.
Do you know how to choose between X11 and Framebuffer as backend for SDL2 (I prefer to have both, but at least one can be a good start)?
Games which would like to prefer wayland when available can use the following code before SDL_Init():
SDL_SetHint(SDL_HINT_VIDEODRIVER, "wayland,x11");
Before you go compiling though, you could just try twiddling with the environment variable SDL_VIDEODRIVER instead. Then you could for instance call your application like so: