include/SDL_render.h
changeset 6530 ba5de88eab60
parent 6528 e978048ced60
child 6578 77d70ec131bc
     1.1 --- a/include/SDL_render.h	Mon Oct 01 21:57:09 2012 -0700
     1.2 +++ b/include/SDL_render.h	Mon Oct 01 22:30:07 2012 -0700
     1.3 @@ -418,6 +418,40 @@
     1.4                                                  SDL_Texture *texture);
     1.5  
     1.6  /**
     1.7 + *  \brief Set device independent resolution for rendering
     1.8 + *
     1.9 + *  \param w      The width of the logical resolution
    1.10 + *  \param h      The height of the logical resolution
    1.11 + *
    1.12 + *  This function uses the viewport and scaling functionality to allow a fixed logical
    1.13 + *  resolution for rendering, regardless of the actual output resolution.  If the actual
    1.14 + *  output resolution doesn't have the same aspect ratio the output rendering will be
    1.15 + *  centered within the output display.
    1.16 + *
    1.17 + *  If the output display is a window, mouse events in the window will be filtered
    1.18 + *  and scaled so they seem to arrive within the logical resolution.
    1.19 + *
    1.20 + *  \note If this function results in scaling or subpixel drawing by the 
    1.21 + *        rendering backend, it will be handled using the appropriate
    1.22 + *        quality hints.
    1.23 + *
    1.24 + *  \sa SDL_RenderGetLogicalSize()
    1.25 + *  \sa SDL_RenderSetScale()
    1.26 + *  \sa SDL_RenderSetViewport()
    1.27 + */
    1.28 +extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h);
    1.29 +
    1.30 +/**
    1.31 + *  \brief Get device independent resolution for rendering
    1.32 + *
    1.33 + *  \param w      A pointer filled with the width of the logical resolution
    1.34 + *  \param h      A pointer filled with the height of the logical resolution
    1.35 + *
    1.36 + *  \sa SDL_RenderSetLogicalSize()
    1.37 + */
    1.38 +extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *y);
    1.39 +
    1.40 +/**
    1.41   *  \brief Set the drawing area for rendering on the current target.
    1.42   *
    1.43   *  \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
    1.44 @@ -426,12 +460,17 @@
    1.45   *
    1.46   *  \note When the window is resized, the current viewport is automatically
    1.47   *        centered within the new window size.
    1.48 + *
    1.49 + *  \sa SDL_RenderGetViewport()
    1.50 + *  \sa SDL_RenderSetLogicalSize()
    1.51   */
    1.52  extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer,
    1.53                                                    const SDL_Rect * rect);
    1.54  
    1.55  /**
    1.56   *  \brief Get the drawing area for the current target.
    1.57 + *
    1.58 + *  \sa SDL_RenderSetViewport()
    1.59   */
    1.60  extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
    1.61                                                     SDL_Rect * rect);
    1.62 @@ -449,6 +488,9 @@
    1.63   *  \note If this results in scaling or subpixel drawing by the 
    1.64   *        rendering backend, it will be handled using the appropriate
    1.65   *        quality hints.  For best results use integer scaling factors.
    1.66 + *
    1.67 + *  \sa SDL_RenderGetScale()
    1.68 + *  \sa SDL_RenderSetLogicalSize()
    1.69   */
    1.70  extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer,
    1.71                                                 float scaleX, float scaleY);
    1.72 @@ -458,6 +500,8 @@
    1.73   *
    1.74   *  \param scaleX A pointer filled in with the horizontal scaling factor
    1.75   *  \param scaleY A pointer filled in with the vertical scaling factor
    1.76 + *
    1.77 + *  \sa SDL_RenderSetScale()
    1.78   */
    1.79  extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer,
    1.80                                                 float *scaleX, float *scaleY);