ClipRect on textures or windows?

Do Textures or Windows support a cliprect, or just surfaces? If so, what API calls do I use for them? Because I can’t seem to find any…

No, they don’t. I’m not opposed to adding one for windows, but it
might be tricky to get right on all the platforms. Do you still need
this?On Tue, Jun 30, 2009 at 6:12 PM, Mason Wheeler wrote:

Do Textures or Windows support a cliprect, or just surfaces?? If so, what
API calls do I use for them? Because I can’t seem to find any…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

I haven’t followed this thread, so I might be missing the point. Anyway…

Cliprects for windows can be handy for GUI toolkits, to keep text and other
things from drawing outside widgets. It’s the nice, safe and easy way.

They’re also handy in games, pretty much whenever you’re not repainting the
whole screen every frame. Two examples:

1. Rendering a playfield with sprites into a rectangular
   area of the screen. (Kobo Deluxe, to mention an example
   that I know is implemented this way. ;-)

2. Updating single sprites in "still screen" games, without
   triggering avalanches of recursive updates. In the
   siplest case, you just set the cliprect to the size and
   position of the sprite, and then redraw everything in
   that area.

BTW, in the case of GUI toolkits (on Win32 GDI and X11 at least), per-widget
clipping is usually handled by using dedicated low level windows, “drawing
contexts” or similar, handling clipping, overlap and more. Not sure how, or
even if, this applies to SDL 1.3.On Tuesday 15 December 2009, at 00.47.56, Sam Lantinga wrote:

No, they don’t. I’m not opposed to adding one for windows, but it
might be tricky to get right on all the platforms. Do you still need
this?

On Tue, Jun 30, 2009 at 6:12 PM, Mason Wheeler wrote:

Do Textures or Windows support a cliprect, or just surfaces? If so, what
API calls do I use for them? Because I can’t seem to find any…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


//David Olofson - Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
’---------------------------------------------------------------------’