mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-08-28 17:41:38 +00:00
Render: Allow empty cliprect.
This fixes an issue where an empty cliprect is treated the same as a NULL
cliprect, causing the render backends to disable clipping.
Also adds a new API, SDL_RenderIsClipEnabled(render) that allows you to
differentiate between:
- SDL_RenderSetClipRect(render, NULL)
- SDL_Rect r = {0,0,0,0}; SDL_RenderSetClipRect(render, &r);
Fixes https://bugzilla.libsdl.org/show_bug.cgi?id=2504
This commit is contained in:
@@ -1145,12 +1145,13 @@ D3D_UpdateViewport(SDL_Renderer * renderer)
|
||||
static int
|
||||
D3D_UpdateClipRect(SDL_Renderer * renderer)
|
||||
{
|
||||
const SDL_Rect *rect = &renderer->clip_rect;
|
||||
D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
|
||||
RECT r;
|
||||
HRESULT result;
|
||||
|
||||
if (!SDL_RectEmpty(rect)) {
|
||||
if (renderer->clipping_enabled) {
|
||||
const SDL_Rect *rect = &renderer->clip_rect;
|
||||
RECT r;
|
||||
HRESULT result;
|
||||
|
||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, TRUE);
|
||||
r.left = rect->x;
|
||||
r.top = rect->y;
|
||||
|
||||
Reference in New Issue
Block a user