ive been throwing this idea around on irc a lot and thought it was time to throw it down here. the idea is to be able to set a clipping rectangle to localize and lock drawing to within the defined area. this is kinda useful for keeping hud gauges in their defined box, but where it would really shine is in dealing with render to texture.
say you want to render your screen to a texture and use it as one of the cockpit textures, then you wanted another one for a radar and another for a weapon status screen. you suddenly have to deal with 3 dynamic textures where it would be more efficient and way faster to only have one and use uv mapping to divide it between all the elements. problem with this is that if you do something like render the frame to the texture it would use up the entire texture, where some parts would want to be reserved for the other gauges. you could also have run over where things may render outside of the desired area, clipping rectangles would prevent that from happening.
while rendering the screen to the texture you want to draw some hud gauges for it, and this requires something like getScreenCoords(), it would return coords in the range of the whole texture. the clipping rectangle would effect those to, so you could set up maybe the top half of the texture as the rear view camera display (or sniper cam or turret cam or whatever) then split up the bottom of the texture among the other panel elements.
usage would be probibly something like gr.setClippingRectangle(x1y1,x2,y2), the coordinate represent a rectangle within the texture. now if you draw a pixel at 0,0, it gets drawn it the top corner of the rectangle, wherever that happens to be in the texture. you could do whatever, including rendering the frame. or getting coordinates which would be in the clipping rectangles local space. once youre done you can gr.setClippingRectangle() without any args to set to default (essentially whatever your render target was).