mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-28 15:39:10 +00:00
Renderer logical size is now implemented as a render target
This fixes rounding errors with coordinate scaling and gives more flexibility in the presentation, as well as making it easy to maintain device independent resolution as windows move between different pixel density displays. By default when a renderer is created, it will match the window size so window coordinates and render coordinates are 1-1. Mouse and touch events are no longer filtered to change their coordinates, instead you can call SDL_ConvertEventToRenderCoordinates() to explicitly map event coordinates into the rendering viewport. SDL_RenderWindowToLogical() and SDL_RenderLogicalToWindow() have been renamed SDL_RenderCoordinatesFromWindow() and SDL_RenderCoordinatesToWindow() and take floating point coordinates in both directions. The viewport, clipping state, and scale for render targets are now persistent and will remain set whenever they are active.
This commit is contained in:
parent
93fc72a405
commit
dcd17f5473
28 changed files with 1113 additions and 910 deletions
|
@ -1143,17 +1143,6 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP"
|
||||
|
||||
/**
|
||||
* \brief A variable controlling whether relative mouse motion is affected by renderer scaling
|
||||
*
|
||||
* This variable can be set to the following values:
|
||||
* "0" - Relative motion is unaffected by display scale or renderer's logical size
|
||||
* "1" - Relative motion is scaled according to display scale scaling and logical size
|
||||
*
|
||||
* By default relative mouse deltas are affected by display scale and renderer scaling
|
||||
*/
|
||||
#define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING"
|
||||
|
||||
/**
|
||||
* \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode
|
||||
*/
|
||||
|
@ -1399,17 +1388,6 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER"
|
||||
|
||||
/**
|
||||
* \brief A variable controlling the scaling policy for SDL_SetRenderLogicalSize.
|
||||
*
|
||||
* This variable can be set to the following values:
|
||||
* "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen
|
||||
* "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen
|
||||
*
|
||||
* By default letterbox is used
|
||||
*/
|
||||
#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE "SDL_RENDER_LOGICAL_SIZE_MODE"
|
||||
|
||||
/**
|
||||
* \brief A variable controlling whether the OpenGL render driver uses shaders if they are available.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue