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:
parent
36e11d87c8
commit
defd90b6f6
11 changed files with 43 additions and 18 deletions
|
@ -551,6 +551,16 @@ extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer,
|
|||
extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer,
|
||||
SDL_Rect * rect);
|
||||
|
||||
/**
|
||||
* \brief Get wether clipping is enabled on the given renderer
|
||||
*
|
||||
* \param renderer The renderer from which clip state should be queried.
|
||||
*
|
||||
* \sa SDL_RenderGetClipRect()
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Set the drawing scale for rendering on the current target.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue