SDL
SDL copied to clipboard
SDL_CreateWindowFrom failed
void create_window()
{
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
qDebug() << "SDL initialization failed";
return;
}
WId id = ui->widget->winId();
SDL_Window* mSDLWindow = SDL_CreateWindowFrom((void*)id );
if (!mSDLWindow1) {
qDebug() << "SDL_CreateWindowFrom failed:" << SDL_GetError();
return;
}
return;
}
When I'm on the Windows platform, I can create it normally. But when I try to create it on Ubuntu, it prompts "That operation is not supported".May I ask why?
Are you using the X or Wayland backend? If it is Wayland, SDL_CreateWindowFrom() was never implemented for that backend in SDL2.
Also I guess make sure id is actually a usable handle (is it an Xlib Window handle? Something from xcb that isn't compatible? Is it a Wayland thing but SDL is talking to XWayland?)