SDL_RenderSetViewport behavior

Initially I believed, that when SDL_RenderSetViewport() is applied to
the current renderer (in SDL2), it would behave like
http://wiki.libsdl.org/moin.cgi/SDL_SetClipRect when applied to the
current screen (in SDL1.2). However, after some experimentation, I found
that setting a viewport also applies a coordinate transformation (i.e. a
new origin is applied and drawing to 0,0 ends up at viewport.x,
viewport.y on the screen).

I think the documentation for
http://wiki.libsdl.org/moin.cgi/SDL_RenderSetViewport could be improved
by adding this info or some sample code with appropriate comments.

Thanks,
–Andreas

If you have a wiki account, I can give you write access.On Sun, Sep 2, 2012 at 10:26 PM, Andreas Schiffler wrote:

Initially I believed, that when SDL_RenderSetViewport() is applied to the
current renderer (in SDL2), it would behave like
http://wiki.libsdl.org/moin.**cgi/SDL_SetClipRecthttp://wiki.libsdl.org/moin.cgi/SDL_SetClipRectwhen applied to the current screen (in SDL1.2). However, after some
experimentation, I found that setting a viewport also applies a coordinate
transformation (i.e. a new origin is applied and drawing to 0,0 ends up at
viewport.x, viewport.y on the screen).

I think the documentation for http://wiki.libsdl.org/moin.**
cgi/SDL_RenderSetViewporthttp://wiki.libsdl.org/moin.cgi/SDL_RenderSetViewportcould be improved by adding this info or some sample code with appropriate
comments.

Thanks,
–Andreas

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