Weston & SDL2 problem

Hi, kind NVIDIA and everyone!
I want to use wayland/weston and SDL2 on Jetson Nano, JetPack4.4.
But, the sample code failed as below:

#include <SDL2/SDL.h>
#include

int main() {
if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
}

SDL_Window *win = SDL_CreateWindow(“Hello World!”, 100, 100, 960, 540, SDL_WINDOW_SHOWN);
if (win == NULL) {
std::cout << "SDL_CreateWindow Error: " << SDL_GetError() << std::endl;
return 1;
}

SDL_Renderer *ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
if (ren == NULL) {
std::cout << "SDL_CreateRenderer Error: " << SDL_GetError() << std::endl;
return 1;
}

SDL_Surface *bmp = SDL_LoadBMP("./boxes.bmp");
if (bmp == NULL) {
std::cout << "SDL_LoadBMP Error: " << SDL_GetError() << std::endl;
return 1;
}

SDL_Texture *tex = SDL_CreateTextureFromSurface(ren, bmp);
SDL_FreeSurface(bmp);
if (tex == NULL) {
std::cout << "SDL_CreateTextureFromSurface Error: " << SDL_GetError() << std::endl;
return 1;
}

for (int i=0; i < 20; i++) {
SDL_RenderClear(ren);
SDL_RenderCopy(ren, tex, NULL, NULL);
SDL_RenderPresent(ren);
SDL_Delay(100);
}

SDL_DestroyTexture(tex);
SDL_DestroyRenderer(ren);
SDL_DestroyWindow(win);
SDL_Quit();

return 0;
}

terminal error output:
libwayland: error in client communication (pid 20048)
zxdg_surface_v6@22: error 3: xdg_surface has never been configured
Unable to show color buffer in an OS-native window (call to eglSwapBuffers failed, reporting an error of EGL_SUCCESS)

Please help me to solve this problem.
Thanks,
Best Regards,
aither

Hi,
For enabling Weston, we have steps in development guide.
Please follow the steps and see if you can do video playback through nveglglessink. If it runs fine, please try the SDL app.

We have samples in

/usr/src/nvidia/graphics_demos

You may also take a look.