pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: devel/sdl2 pkgsrc-2026Q3 transparent/corrupted X11 window
ea1abz%gmail.com@localhost (Ramiro Aceves) writes:
>I believe there is a problem with SDL2 and X11 in pkgsrc-2026Q3 on NetBSD.
>After updating my system to pkgsrc-2026Q3, applications using SDL2 create
> a corrupted/transparent X11 window. The desktop contents can be seen
>through the application window.
The window is not refreshed by the application, so the previous screen
content is still visible.
You need to add an event loop that calls something like
SDL_UpdateWindowSurface(window);
to refresh the window contents.
E.g.:
SDL_Event event;
bool end;
end = false;
while (!end) {
if (SDL_WaitEvent(&event)) {
switch (event.type) {
case SDL_QUIT:
end = true;
break;
case SDL_WINDOWEVENT:
switch (event.window.event) {
case SDL_WINDOWEVENT_EXPOSED:
SDL_UpdateWindowSurface(window);
break;
}
break;
}
}
}
This reacts to window exposure and handles a QUIT event from the
window manager to exit the loop.
This has always been necessary, but maybe not that obvious. If
enough render commands have been pushed before waiting, these
could have been flushed out to the display arelady, but there
is no guarantee.
Waiting for an event triggers such a flush.
Handling the exposure event makes sure that the display is
updated when the window is e.g. moved, resized, exposed, etc...
Home |
Main Index |
Thread Index |
Old Index