imgui_sdl icon indicating copy to clipboard operation
imgui_sdl copied to clipboard

Broken rendering in "Custom rendering"-window of example

Open JayFoxRox opened this issue 6 years ago • 0 comments

There's some broken garbage in the background of some primitives from the start:

2019-11-14-074315_493x297_scrot

However, the primitives also break further when changing the thickness (I moved it away from 3.0, then back to 3.0):

2019-11-14-074336_494x291_scrot


This seems to be a side-effect of #6, where the SDL_RenderClear in Device::UseAsRenderTarget doesn't work correctly.

It can be worked around by SDL_RenderSetClipRect(Renderer, (SDL_Rect*)texture); (hack to workaround SDL bug; any non-nullptr is fine) in Device::UseAsRenderTarget. You also have to move the CurrentDevice->DisableClip(); call to after CurrentDevice->UseAsRenderTarget(cache);

This bug should be fixed by the next SDL release. I'm just leaving it here to document what's going on. It should only affect GL (and GL ES) based SDL_Render backends.

JayFoxRox avatar Nov 14 '19 06:11 JayFoxRox