Rename SDL_GetDisplayDPI to SDL_GetDisplayPhysicalDPI
to avoid confusion with logical DPI
This commit is contained in:
@@ -164,7 +164,7 @@ SDL3_0.0.0 {
|
||||
SDL_GetDefaultCursor;
|
||||
SDL_GetDesktopDisplayMode;
|
||||
SDL_GetDisplayBounds;
|
||||
SDL_GetDisplayDPI;
|
||||
SDL_GetDisplayPhysicalDPI;
|
||||
SDL_GetDisplayIndexForPoint;
|
||||
SDL_GetDisplayIndexForRect;
|
||||
SDL_GetDisplayMode;
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
#define SDL_GetDefaultCursor SDL_GetDefaultCursor_REAL
|
||||
#define SDL_GetDesktopDisplayMode SDL_GetDesktopDisplayMode_REAL
|
||||
#define SDL_GetDisplayBounds SDL_GetDisplayBounds_REAL
|
||||
#define SDL_GetDisplayDPI SDL_GetDisplayDPI_REAL
|
||||
#define SDL_GetDisplayPhysicalDPI SDL_GetDisplayPhysicalDPI_REAL
|
||||
#define SDL_GetDisplayIndexForPoint SDL_GetDisplayIndexForPoint_REAL
|
||||
#define SDL_GetDisplayIndexForRect SDL_GetDisplayIndexForRect_REAL
|
||||
#define SDL_GetDisplayMode SDL_GetDisplayMode_REAL
|
||||
|
||||
@@ -263,7 +263,7 @@ SDL_DYNAPI_PROC(int,SDL_GetDefaultAudioInfo,(char **a, SDL_AudioSpec *b, int c),
|
||||
SDL_DYNAPI_PROC(SDL_Cursor*,SDL_GetDefaultCursor,(void),(),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDesktopDisplayMode,(int a, SDL_DisplayMode *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDisplayBounds,(int a, SDL_Rect *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDisplayDPI,(int a, float *b, float *c, float *d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDisplayPhysicalDPI,(int a, float *b, float *c, float *d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDisplayIndexForPoint,(const SDL_Point *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDisplayIndexForRect,(const SDL_Rect *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDisplayMode,(int a, int b, SDL_DisplayMode *c),(a,b,c),return)
|
||||
|
||||
@@ -1128,7 +1128,7 @@ SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
SDL_zero(usablebounds);
|
||||
SDL_GetDisplayUsableBounds(i, &usablebounds);
|
||||
|
||||
SDL_GetDisplayDPI(i, NULL, &hdpi, &vdpi);
|
||||
SDL_GetDisplayPhysicalDPI(i, NULL, &hdpi, &vdpi);
|
||||
|
||||
SDL_Log("Bounds: %dx%d at %d,%d\n", bounds.w, bounds.h, bounds.x, bounds.y);
|
||||
SDL_Log("Usable bounds: %dx%d at %d,%d\n", usablebounds.w, usablebounds.h, usablebounds.x, usablebounds.y);
|
||||
@@ -2296,8 +2296,8 @@ void SDLTest_CommonDrawWindowInfo(SDL_Renderer *renderer, SDL_Window *window, fl
|
||||
textY += lineHeight;
|
||||
}
|
||||
|
||||
if (0 == SDL_GetDisplayDPI(windowDisplayIndex, &ddpi, &hdpi, &vdpi)) {
|
||||
(void)SDL_snprintf(text, sizeof text, "SDL_GetDisplayDPI: ddpi: %f, hdpi: %f, vdpi: %f",
|
||||
if (0 == SDL_GetDisplayPhysicalDPI(windowDisplayIndex, &ddpi, &hdpi, &vdpi)) {
|
||||
(void)SDL_snprintf(text, sizeof text, "SDL_GetDisplayPhysicalDPI: ddpi: %f, hdpi: %f, vdpi: %f",
|
||||
ddpi, hdpi, vdpi);
|
||||
SDLTest_DrawString(renderer, 0.0f, textY, text);
|
||||
textY += lineHeight;
|
||||
|
||||
@@ -746,7 +746,7 @@ int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect *rect)
|
||||
return SDL_GetDisplayBounds(displayIndex, rect);
|
||||
}
|
||||
|
||||
int SDL_GetDisplayDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi)
|
||||
int SDL_GetDisplayPhysicalDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi)
|
||||
{
|
||||
SDL_VideoDisplay *display;
|
||||
|
||||
|
||||
@@ -637,7 +637,7 @@ void WIN_ScreenPointFromSDLFloat(float x, float y, LONG *xOut, LONG *yOut, int *
|
||||
goto passthrough;
|
||||
}
|
||||
|
||||
if (SDL_GetDisplayBounds(displayIndex, &bounds) < 0 || SDL_GetDisplayDPI(displayIndex, &ddpi, &hdpi, &vdpi) < 0) {
|
||||
if (SDL_GetDisplayBounds(displayIndex, &bounds) < 0 || SDL_GetDisplayPhysicalDPI(displayIndex, &ddpi, &hdpi, &vdpi) < 0) {
|
||||
goto passthrough;
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ void WIN_ScreenPointToSDLFloat(LONG x, LONG y, float *xOut, float *yOut)
|
||||
}
|
||||
|
||||
/* Get SDL display properties */
|
||||
if (SDL_GetDisplayBounds(displayIndex, &bounds) < 0 || SDL_GetDisplayDPI(displayIndex, &ddpi, &hdpi, &vdpi) < 0) {
|
||||
if (SDL_GetDisplayBounds(displayIndex, &bounds) < 0 || SDL_GetDisplayPhysicalDPI(displayIndex, &ddpi, &hdpi, &vdpi) < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user