Fixed display orientation function names for SDL 3.0 convention
parent
d91e96e7f5
commit
9fe384b696
|
@ -1139,7 +1139,7 @@ The SDL_WINDOW_TOOLTIP and SDL_WINDOW_POPUP_MENU window flags are now supported
|
||||||
|
|
||||||
The following functions have been renamed:
|
The following functions have been renamed:
|
||||||
* SDL_GetClosestDisplayMode() => SDL_GetClosestFullscreenDisplayMode()
|
* SDL_GetClosestDisplayMode() => SDL_GetClosestFullscreenDisplayMode()
|
||||||
* SDL_GetDisplayOrientation() => SDL_GetDisplayCurrentOrientation()
|
* SDL_GetDisplayOrientation() => SDL_GetCurrentDisplayOrientation()
|
||||||
* SDL_GetPointDisplayIndex() => SDL_GetDisplayForPoint()
|
* SDL_GetPointDisplayIndex() => SDL_GetDisplayForPoint()
|
||||||
* SDL_GetRectDisplayIndex() => SDL_GetDisplayForRect()
|
* SDL_GetRectDisplayIndex() => SDL_GetDisplayForRect()
|
||||||
* SDL_GetWindowDisplayIndex() => SDL_GetDisplayForWindow()
|
* SDL_GetWindowDisplayIndex() => SDL_GetDisplayForWindow()
|
||||||
|
|
|
@ -466,7 +466,7 @@
|
||||||
|
|
||||||
/* ##SDL_video.h */
|
/* ##SDL_video.h */
|
||||||
#define SDL_GetClosestDisplayMode SDL_GetClosestFullscreenDisplayMode
|
#define SDL_GetClosestDisplayMode SDL_GetClosestFullscreenDisplayMode
|
||||||
#define SDL_GetDisplayOrientation SDL_GetDisplayCurrentOrientation
|
#define SDL_GetDisplayOrientation SDL_GetCurrentDisplayOrientation
|
||||||
#define SDL_GetPointDisplayIndex SDL_GetDisplayForPoint
|
#define SDL_GetPointDisplayIndex SDL_GetDisplayForPoint
|
||||||
#define SDL_GetRectDisplayIndex SDL_GetDisplayForRect
|
#define SDL_GetRectDisplayIndex SDL_GetDisplayForRect
|
||||||
#define SDL_GetWindowDisplayIndex SDL_GetDisplayForWindow
|
#define SDL_GetWindowDisplayIndex SDL_GetDisplayForWindow
|
||||||
|
@ -903,7 +903,7 @@
|
||||||
|
|
||||||
/* ##SDL_video.h */
|
/* ##SDL_video.h */
|
||||||
#define SDL_GetClosestDisplayMode SDL_GetClosestDisplayMode_renamed_SDL_GetClosestFullscreenDisplayMode
|
#define SDL_GetClosestDisplayMode SDL_GetClosestDisplayMode_renamed_SDL_GetClosestFullscreenDisplayMode
|
||||||
#define SDL_GetDisplayOrientation SDL_GetDisplayOrientation_renamed_SDL_GetDisplayCurrentOrientation
|
#define SDL_GetDisplayOrientation SDL_GetDisplayOrientation_renamed_SDL_GetCurrentDisplayOrientation
|
||||||
#define SDL_GetPointDisplayIndex SDL_GetPointDisplayIndex_renamed_SDL_GetDisplayForPoint
|
#define SDL_GetPointDisplayIndex SDL_GetPointDisplayIndex_renamed_SDL_GetDisplayForPoint
|
||||||
#define SDL_GetRectDisplayIndex SDL_GetRectDisplayIndex_renamed_SDL_GetDisplayForRect
|
#define SDL_GetRectDisplayIndex SDL_GetRectDisplayIndex_renamed_SDL_GetDisplayForRect
|
||||||
#define SDL_GetWindowDisplayIndex SDL_GetWindowDisplayIndex_renamed_SDL_GetDisplayForWindow
|
#define SDL_GetWindowDisplayIndex SDL_GetWindowDisplayIndex_renamed_SDL_GetDisplayForWindow
|
||||||
|
|
|
@ -96,7 +96,7 @@ typedef enum
|
||||||
*
|
*
|
||||||
* The axis data is not changed when the device is rotated.
|
* The axis data is not changed when the device is rotated.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetDisplayCurrentOrientation()
|
* \sa SDL_GetCurrentDisplayOrientation()
|
||||||
*/
|
*/
|
||||||
#define SDL_STANDARD_GRAVITY 9.80665f
|
#define SDL_STANDARD_GRAVITY 9.80665f
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ typedef enum
|
||||||
*
|
*
|
||||||
* The axis data is not changed when the device is rotated.
|
* The axis data is not changed when the device is rotated.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetDisplayCurrentOrientation()
|
* \sa SDL_GetCurrentDisplayOrientation()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
|
|
|
@ -405,7 +405,7 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(SDL_DisplayID displayID,
|
||||||
*
|
*
|
||||||
* \sa SDL_GetDisplays
|
* \sa SDL_GetDisplays
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayNaturalOrientation(SDL_DisplayID displayID);
|
extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetNaturalDisplayOrientation(SDL_DisplayID displayID);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the orientation of a display.
|
* Get the orientation of a display.
|
||||||
|
@ -418,7 +418,7 @@ extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayNaturalOrientation(
|
||||||
*
|
*
|
||||||
* \sa SDL_GetDisplays
|
* \sa SDL_GetDisplays
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayCurrentOrientation(SDL_DisplayID displayID);
|
extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetCurrentDisplayOrientation(SDL_DisplayID displayID);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the content scale of a display.
|
* Get the content scale of a display.
|
||||||
|
|
|
@ -166,7 +166,7 @@ SDL3_0.0.0 {
|
||||||
SDL_GetDisplayForPoint;
|
SDL_GetDisplayForPoint;
|
||||||
SDL_GetDisplayForRect;
|
SDL_GetDisplayForRect;
|
||||||
SDL_GetDisplayName;
|
SDL_GetDisplayName;
|
||||||
SDL_GetDisplayCurrentOrientation;
|
SDL_GetCurrentDisplayOrientation;
|
||||||
SDL_GetDisplayUsableBounds;
|
SDL_GetDisplayUsableBounds;
|
||||||
SDL_GetError;
|
SDL_GetError;
|
||||||
SDL_GetErrorMsg;
|
SDL_GetErrorMsg;
|
||||||
|
@ -866,7 +866,7 @@ SDL3_0.0.0 {
|
||||||
SDL_hid_get_report_descriptor;
|
SDL_hid_get_report_descriptor;
|
||||||
SDL_HasWindowSurface;
|
SDL_HasWindowSurface;
|
||||||
SDL_DestroyWindowSurface;
|
SDL_DestroyWindowSurface;
|
||||||
SDL_GetDisplayNaturalOrientation;
|
SDL_GetNaturalDisplayOrientation;
|
||||||
# extra symbols go here (don't modify this line)
|
# extra symbols go here (don't modify this line)
|
||||||
local: *;
|
local: *;
|
||||||
};
|
};
|
||||||
|
|
|
@ -190,7 +190,7 @@
|
||||||
#define SDL_GetDisplayForPoint SDL_GetDisplayForPoint_REAL
|
#define SDL_GetDisplayForPoint SDL_GetDisplayForPoint_REAL
|
||||||
#define SDL_GetDisplayForRect SDL_GetDisplayForRect_REAL
|
#define SDL_GetDisplayForRect SDL_GetDisplayForRect_REAL
|
||||||
#define SDL_GetDisplayName SDL_GetDisplayName_REAL
|
#define SDL_GetDisplayName SDL_GetDisplayName_REAL
|
||||||
#define SDL_GetDisplayCurrentOrientation SDL_GetDisplayCurrentOrientation_REAL
|
#define SDL_GetCurrentDisplayOrientation SDL_GetCurrentDisplayOrientation_REAL
|
||||||
#define SDL_GetDisplayUsableBounds SDL_GetDisplayUsableBounds_REAL
|
#define SDL_GetDisplayUsableBounds SDL_GetDisplayUsableBounds_REAL
|
||||||
#define SDL_GetError SDL_GetError_REAL
|
#define SDL_GetError SDL_GetError_REAL
|
||||||
#define SDL_GetErrorMsg SDL_GetErrorMsg_REAL
|
#define SDL_GetErrorMsg SDL_GetErrorMsg_REAL
|
||||||
|
@ -892,4 +892,4 @@
|
||||||
#define SDL_hid_get_report_descriptor SDL_hid_get_report_descriptor_REAL
|
#define SDL_hid_get_report_descriptor SDL_hid_get_report_descriptor_REAL
|
||||||
#define SDL_HasWindowSurface SDL_HasWindowSurface_REAL
|
#define SDL_HasWindowSurface SDL_HasWindowSurface_REAL
|
||||||
#define SDL_DestroyWindowSurface SDL_DestroyWindowSurface_REAL
|
#define SDL_DestroyWindowSurface SDL_DestroyWindowSurface_REAL
|
||||||
#define SDL_GetDisplayNaturalOrientation SDL_GetDisplayNaturalOrientation_REAL
|
#define SDL_GetNaturalDisplayOrientation SDL_GetNaturalDisplayOrientation_REAL
|
||||||
|
|
|
@ -265,7 +265,7 @@ SDL_DYNAPI_PROC(int,SDL_GetDisplayBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),re
|
||||||
SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetDisplayForPoint,(const SDL_Point *a),(a),return)
|
SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetDisplayForPoint,(const SDL_Point *a),(a),return)
|
||||||
SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetDisplayForRect,(const SDL_Rect *a),(a),return)
|
SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetDisplayForRect,(const SDL_Rect *a),(a),return)
|
||||||
SDL_DYNAPI_PROC(const char*,SDL_GetDisplayName,(SDL_DisplayID a),(a),return)
|
SDL_DYNAPI_PROC(const char*,SDL_GetDisplayName,(SDL_DisplayID a),(a),return)
|
||||||
SDL_DYNAPI_PROC(SDL_DisplayOrientation,SDL_GetDisplayCurrentOrientation,(SDL_DisplayID a),(a),return)
|
SDL_DYNAPI_PROC(SDL_DisplayOrientation,SDL_GetCurrentDisplayOrientation,(SDL_DisplayID a),(a),return)
|
||||||
SDL_DYNAPI_PROC(int,SDL_GetDisplayUsableBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return)
|
SDL_DYNAPI_PROC(int,SDL_GetDisplayUsableBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return)
|
||||||
SDL_DYNAPI_PROC(const char*,SDL_GetError,(void),(),return)
|
SDL_DYNAPI_PROC(const char*,SDL_GetError,(void),(),return)
|
||||||
SDL_DYNAPI_PROC(char*,SDL_GetErrorMsg,(char *a, int b),(a,b),return)
|
SDL_DYNAPI_PROC(char*,SDL_GetErrorMsg,(char *a, int b),(a,b),return)
|
||||||
|
@ -937,4 +937,4 @@ SDL_DYNAPI_PROC(SDL_hid_device_info*,SDL_hid_get_device_info,(SDL_hid_device *a)
|
||||||
SDL_DYNAPI_PROC(int,SDL_hid_get_report_descriptor,(SDL_hid_device *a, unsigned char *b, size_t c),(a,b,c),return)
|
SDL_DYNAPI_PROC(int,SDL_hid_get_report_descriptor,(SDL_hid_device *a, unsigned char *b, size_t c),(a,b,c),return)
|
||||||
SDL_DYNAPI_PROC(SDL_bool,SDL_HasWindowSurface,(SDL_Window *a),(a),return)
|
SDL_DYNAPI_PROC(SDL_bool,SDL_HasWindowSurface,(SDL_Window *a),(a),return)
|
||||||
SDL_DYNAPI_PROC(int,SDL_DestroyWindowSurface,(SDL_Window *a),(a),return)
|
SDL_DYNAPI_PROC(int,SDL_DestroyWindowSurface,(SDL_Window *a),(a),return)
|
||||||
SDL_DYNAPI_PROC(SDL_DisplayOrientation,SDL_GetDisplayNaturalOrientation,(SDL_DisplayID a),(a),return)
|
SDL_DYNAPI_PROC(SDL_DisplayOrientation,SDL_GetNaturalDisplayOrientation,(SDL_DisplayID a),(a),return)
|
||||||
|
|
|
@ -657,7 +657,7 @@ static void AttemptSensorFusion(SDL_Joystick *joystick, SDL_bool invert_sensors)
|
||||||
When a phone is being used as a gamepad, its orientation changes,
|
When a phone is being used as a gamepad, its orientation changes,
|
||||||
so adjust sensor axes to match.
|
so adjust sensor axes to match.
|
||||||
*/
|
*/
|
||||||
if (SDL_GetDisplayNaturalOrientation(SDL_GetPrimaryDisplay()) == SDL_ORIENTATION_LANDSCAPE) {
|
if (SDL_GetNaturalDisplayOrientation(SDL_GetPrimaryDisplay()) == SDL_ORIENTATION_LANDSCAPE) {
|
||||||
/* When a device in landscape orientation is laid flat, the axes change
|
/* When a device in landscape orientation is laid flat, the axes change
|
||||||
orientation as follows:
|
orientation as follows:
|
||||||
-X to +X becomes -X to +X
|
-X to +X becomes -X to +X
|
||||||
|
|
|
@ -2464,13 +2464,13 @@ void SDLTest_CommonDrawWindowInfo(SDL_Renderer *renderer, SDL_Window *window, fl
|
||||||
textY += lineHeight;
|
textY += lineHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)SDL_snprintf(text, sizeof(text), "SDL_GetDisplayNaturalOrientation: ");
|
(void)SDL_snprintf(text, sizeof(text), "SDL_GetNaturalDisplayOrientation: ");
|
||||||
SDLTest_PrintDisplayOrientation(text, sizeof(text), SDL_GetDisplayNaturalOrientation(windowDisplayID));
|
SDLTest_PrintDisplayOrientation(text, sizeof(text), SDL_GetNaturalDisplayOrientation(windowDisplayID));
|
||||||
SDLTest_DrawString(renderer, 0.0f, textY, text);
|
SDLTest_DrawString(renderer, 0.0f, textY, text);
|
||||||
textY += lineHeight;
|
textY += lineHeight;
|
||||||
|
|
||||||
(void)SDL_snprintf(text, sizeof(text), "SDL_GetDisplayCurrentOrientation: ");
|
(void)SDL_snprintf(text, sizeof(text), "SDL_GetCurrentDisplayOrientation: ");
|
||||||
SDLTest_PrintDisplayOrientation(text, sizeof(text), SDL_GetDisplayCurrentOrientation(windowDisplayID));
|
SDLTest_PrintDisplayOrientation(text, sizeof(text), SDL_GetCurrentDisplayOrientation(windowDisplayID));
|
||||||
SDLTest_DrawString(renderer, 0.0f, textY, text);
|
SDLTest_DrawString(renderer, 0.0f, textY, text);
|
||||||
textY += lineHeight;
|
textY += lineHeight;
|
||||||
|
|
||||||
|
|
|
@ -889,7 +889,7 @@ int SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect *rect)
|
||||||
return SDL_GetDisplayBounds(displayID, rect);
|
return SDL_GetDisplayBounds(displayID, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_DisplayOrientation SDL_GetDisplayNaturalOrientation(SDL_DisplayID displayID)
|
SDL_DisplayOrientation SDL_GetNaturalDisplayOrientation(SDL_DisplayID displayID)
|
||||||
{
|
{
|
||||||
SDL_VideoDisplay *display = SDL_GetVideoDisplay(displayID);
|
SDL_VideoDisplay *display = SDL_GetVideoDisplay(displayID);
|
||||||
|
|
||||||
|
@ -903,7 +903,7 @@ SDL_DisplayOrientation SDL_GetDisplayNaturalOrientation(SDL_DisplayID displayID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_DisplayOrientation SDL_GetDisplayCurrentOrientation(SDL_DisplayID displayID)
|
SDL_DisplayOrientation SDL_GetCurrentDisplayOrientation(SDL_DisplayID displayID)
|
||||||
{
|
{
|
||||||
SDL_VideoDisplay *display = SDL_GetVideoDisplay(displayID);
|
SDL_VideoDisplay *display = SDL_GetVideoDisplay(displayID);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue