When the window is resized, the viewport is automatically reset.

This resolves lots of confusion around resizable windows.  Most people don't expect a viewport to be implicitly set when the renderer is created and then not to be reset to the window size if the window is resized.

Added common test command line parameters --logical WxH and --scale N to test the render logical size and scaling APIs.
This commit is contained in:
Sam Lantinga
2013-05-29 03:22:19 -07:00
parent 23f33cb76c
commit 028c19b92b
5 changed files with 40 additions and 44 deletions

View File

@@ -481,8 +481,7 @@ extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, i
*
* \return 0 on success, or -1 on error
*
* \note When the window is resized, the current viewport is automatically
* centered within the new window size.
* \note If the window associated with the renderer is resized, the viewport is automatically reset.
*
* \sa SDL_RenderGetViewport()
* \sa SDL_RenderSetLogicalSize()

View File

@@ -69,6 +69,9 @@ typedef struct
int window_minH;
int window_maxW;
int window_maxH;
int logical_w;
int logical_h;
float scale;
int depth;
int refresh_rate;
int num_windows;