|
|
@ -120,9 +120,11 @@ void ImGui_ImplSDLRenderer_RenderDrawData(ImDrawData* draw_data)
|
|
|
|
struct BackupSDLRendererState
|
|
|
|
struct BackupSDLRendererState
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SDL_Rect Viewport;
|
|
|
|
SDL_Rect Viewport;
|
|
|
|
|
|
|
|
bool ClipEnabled;
|
|
|
|
SDL_Rect ClipRect;
|
|
|
|
SDL_Rect ClipRect;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
BackupSDLRendererState old = {};
|
|
|
|
BackupSDLRendererState old = {};
|
|
|
|
|
|
|
|
old.ClipEnabled = SDL_RenderIsClipEnabled(bd->SDLRenderer);
|
|
|
|
SDL_RenderGetViewport(bd->SDLRenderer, &old.Viewport);
|
|
|
|
SDL_RenderGetViewport(bd->SDLRenderer, &old.Viewport);
|
|
|
|
SDL_RenderGetClipRect(bd->SDLRenderer, &old.ClipRect);
|
|
|
|
SDL_RenderGetClipRect(bd->SDLRenderer, &old.ClipRect);
|
|
|
|
|
|
|
|
|
|
|
@ -183,7 +185,7 @@ void ImGui_ImplSDLRenderer_RenderDrawData(ImDrawData* draw_data)
|
|
|
|
|
|
|
|
|
|
|
|
// Restore modified SDL_Renderer state
|
|
|
|
// Restore modified SDL_Renderer state
|
|
|
|
SDL_RenderSetViewport(bd->SDLRenderer, &old.Viewport);
|
|
|
|
SDL_RenderSetViewport(bd->SDLRenderer, &old.Viewport);
|
|
|
|
SDL_RenderSetClipRect(bd->SDLRenderer, &old.ClipRect);
|
|
|
|
SDL_RenderSetClipRect(bd->SDLRenderer, old.ClipEnabled ? &old.ClipRect : NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Called by Init/NewFrame/Shutdown
|
|
|
|
// Called by Init/NewFrame/Shutdown
|
|
|
|