| Summary: | SDL_HideWindow will also suspend rendering | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ellie <etc0de> |
| Component: | render | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED WONTFIX | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | don't know | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
|
Description
Ellie
2017-10-29 02:08:57 UTC
I forgot to mention what I'm actually doing: I'm using SDL_RenderReadPixels to extract the pixels after rendering a frame, and with the hidden window I simply get a pitch black texture instead of the actual image. If I change nothing else except commenting the line that hides the window, everything works fine and I can extract the proper image. Anyone? I need off-screen rendering in a couple of places, and this makes it really challenging ot use SDL2 for that purpose. Any sort of feedback on whether this is unavoidable per design or a fixable bug would already be nice, because if there is no hope this ever gets addressed I'll have to look into other options than SDL2. Ryan, can you take a look at this? Is there something we need to set to allow off-screen rendering? Does this work if you use a render target instead of rendering directly to the hidden window? --ryan. I didn't try render targets, because the API doesn't appear to support SDL_TEXTUREACCESS_TARGET and SDL_TEXTUREACCESS_STREAMING at the same time since they are enumerations and not flags. Therefore, I'd either need a way to combine SDL_TEXTUREACCESS_TARGET and SDL_TEXTUREACCESS_STREAMING on one SDL_Texture, or I have no other way than to rely on SDL_RenderReadPixels() to get the end result again, which is what I used in the end. Did I miss something so that I can do this with render targets without using OpenGL code myself? So my suspicion is that X11 won't render to an unmapped window; hiding a window unmaps it. You might be able to place the window entirely offscreen (at like, position -10000,-10000) to get around this, but I haven't tried. That being said: SDL_RenderReadPixels() works from render targets, and you don't need to mark them as streaming. I _think_ these will work even if the window is unmapped. --ryan. Going to close this as WONTFIX for now. If you try any of these things (moving the window way offscreen or a render target) and nothing works, we can brainstorm some more. --ryan. |