mirror of
https://github.com/yawut/SDL.git
synced 2026-08-11 11:35:36 -05:00
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:
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user