-
Notifications
You must be signed in to change notification settings - Fork 31
Conversation
I'm a little short on time these days, so I can't try this out, but I don't think we could discard whatever clip rects ImGui is feeding us, as it might actually be important clipping, for like a scroll-area or something? I might be mistaken too. |
The ImGUISDL function void SetClipRect(const ClipRect& rect)
{
Clip = rect;
const SDL_Rect clip = { rect.X, rect.Y, rect.Width, rect.Height };
SDL_RenderSetClipRect(Renderer, &clip);
} Notice that its purpose is to pass a clip rect to int
SDL_RenderSetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
{
CHECK_RENDERER_MAGIC(renderer, -1)
if (rect) {
renderer->clip_rect.x = (int)SDL_floor(rect->x * renderer->scale.x);
renderer->clip_rect.y = (int)SDL_floor(rect->y * renderer->scale.y);
renderer->clip_rect.w = (int)SDL_ceil(rect->w * renderer->scale.x);
renderer->clip_rect.h = (int)SDL_ceil(rect->h * renderer->scale.y);
} else {
SDL_zero(renderer->clip_rect);
}
return renderer->UpdateClipRect(renderer);
}
|
I know what clip recting does, and what you are suggesting here is essentially disabling clip recting totally (since a fullscreen cliprect means that everything rendered will pass the clip test). However, the ImGui rendering API provides us with a clip rect that it has most certainly deemed necessary, and hence discarding that doesn't seem wise to me. |
This should probably be rejected, if #6 (comment) is correct. We should wait for SDL 2.0.11 and hope that SDL 2.0.9 / SDL 2.0.10 (those should be the only ones that are broken) don't propagate into any LTS releases. |
I'm inclined to agree with @JayFoxRox. We can wait until the new version of SDL, and ensure that the issue does not persist into a new version. |
Great, I'll close this one! |
After creating the Renderer calling SDL_RenderSetClipRect with any SDL_Rect* but nullpr fixes the problem for me: SDL_Renderer* ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED); |
Fixes #6