diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index 8fcce2af9e..26fb21da76 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -304,7 +304,7 @@ static jmethodID midClipboardSetText; static jmethodID midCreateCustomCursor; static jmethodID midDestroyCustomCursor; static jmethodID midGetContext; -static jmethodID midGetDisplayDPI; +static jmethodID midGetDisplayPhysicalDPI; static jmethodID midGetManifestEnvironmentVariables; static jmethodID midGetNativeSurface; static jmethodID midInitTouch; @@ -593,7 +593,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetupJNI)(JNIEnv *env, jclass cl midCreateCustomCursor = (*env)->GetStaticMethodID(env, mActivityClass, "createCustomCursor", "([IIIII)I"); midDestroyCustomCursor = (*env)->GetStaticMethodID(env, mActivityClass, "destroyCustomCursor", "(I)V"); midGetContext = (*env)->GetStaticMethodID(env, mActivityClass, "getContext", "()Landroid/content/Context;"); - midGetDisplayDPI = (*env)->GetStaticMethodID(env, mActivityClass, "getDisplayDPI", "()Landroid/util/DisplayMetrics;"); + midGetDisplayPhysicalDPI = (*env)->GetStaticMethodID(env, mActivityClass, "getDisplayDPI", "()Landroid/util/DisplayMetrics;"); midGetManifestEnvironmentVariables = (*env)->GetStaticMethodID(env, mActivityClass, "getManifestEnvironmentVariables", "()Z"); midGetNativeSurface = (*env)->GetStaticMethodID(env, mActivityClass, "getNativeSurface", "()Landroid/view/Surface;"); midInitTouch = (*env)->GetStaticMethodID(env, mActivityClass, "initTouch", "()V"); @@ -624,7 +624,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetupJNI)(JNIEnv *env, jclass cl !midCreateCustomCursor || !midDestroyCustomCursor || !midGetContext || - !midGetDisplayDPI || + !midGetDisplayPhysicalDPI || !midGetManifestEnvironmentVariables || !midGetNativeSurface || !midInitTouch || @@ -1650,11 +1650,11 @@ SDL_DisplayOrientation Android_JNI_GetDisplayOrientation(void) return displayOrientation; } -int Android_JNI_GetDisplayDPI(float *ddpi, float *xdpi, float *ydpi) +int Android_JNI_GetDisplayPhysicalDPI(float *ddpi, float *xdpi, float *ydpi) { JNIEnv *env = Android_JNI_GetEnv(); - jobject jDisplayObj = (*env)->CallStaticObjectMethod(env, mActivityClass, midGetDisplayDPI); + jobject jDisplayObj = (*env)->CallStaticObjectMethod(env, mActivityClass, midGetDisplayPhysicalDPI); jclass jDisplayClass = (*env)->GetObjectClass(env, jDisplayObj); jfieldID fidXdpi = (*env)->GetFieldID(env, jDisplayClass, "xdpi", "F"); diff --git a/src/core/android/SDL_android.h b/src/core/android/SDL_android.h index 7624e46fa9..89feef7dd8 100644 --- a/src/core/android/SDL_android.h +++ b/src/core/android/SDL_android.h @@ -44,7 +44,7 @@ extern SDL_bool Android_JNI_IsScreenKeyboardShown(void); extern ANativeWindow *Android_JNI_GetNativeWindow(void); extern SDL_DisplayOrientation Android_JNI_GetDisplayOrientation(void); -extern int Android_JNI_GetDisplayDPI(float *ddpi, float *xdpi, float *ydpi); +extern int Android_JNI_GetDisplayPhysicalDPI(float *ddpi, float *xdpi, float *ydpi); /* Audio support */ extern void Android_DetectDevices(void); diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index f61d5d3bda..b68ed319bf 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -196,7 +196,7 @@ struct SDL_VideoDevice /* * Get the dots/pixels-per-inch of a display */ - int (*GetDisplayDPI)(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); + int (*GetDisplayPhysicalDPI)(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); /* * Get a list of the available display modes for a display. diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 7916b90ddb..6b8bd6a671 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -754,8 +754,8 @@ int SDL_GetDisplayPhysicalDPI(int displayIndex, float *ddpi, float *hdpi, float display = &_this->displays[displayIndex]; - if (_this->GetDisplayDPI) { - if (_this->GetDisplayDPI(_this, display, ddpi, hdpi, vdpi) == 0) { + if (_this->GetDisplayPhysicalDPI) { + if (_this->GetDisplayPhysicalDPI(_this, display, ddpi, hdpi, vdpi) == 0) { return 0; } } else { diff --git a/src/video/android/SDL_androidvideo.c b/src/video/android/SDL_androidvideo.c index 2949ba4294..9d9d69cd7e 100644 --- a/src/video/android/SDL_androidvideo.c +++ b/src/video/android/SDL_androidvideo.c @@ -44,7 +44,7 @@ /* Initialization/Query functions */ static int Android_VideoInit(_THIS); static void Android_VideoQuit(_THIS); -int Android_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); +int Android_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); #include "../SDL_egl_c.h" #define Android_GLES_GetProcAddress SDL_EGL_GetProcAddressInternal @@ -109,7 +109,7 @@ static SDL_VideoDevice *Android_CreateDevice(void) device->PumpEvents = Android_PumpEvents_NonBlocking; } - device->GetDisplayDPI = Android_GetDisplayDPI; + device->GetDisplayPhysicalDPI = Android_GetDisplayPhysicalDPI; device->CreateSDLWindow = Android_CreateWindow; device->SetWindowTitle = Android_SetWindowTitle; @@ -206,9 +206,9 @@ void Android_VideoQuit(_THIS) Android_QuitTouch(); } -int Android_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi) +int Android_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi) { - return Android_JNI_GetDisplayDPI(ddpi, hdpi, vdpi); + return Android_JNI_GetDisplayPhysicalDPI(ddpi, hdpi, vdpi); } void Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, float rate) diff --git a/src/video/cocoa/SDL_cocoamodes.h b/src/video/cocoa/SDL_cocoamodes.h index 67016c81aa..ea65fdb079 100644 --- a/src/video/cocoa/SDL_cocoamodes.h +++ b/src/video/cocoa/SDL_cocoamodes.h @@ -37,7 +37,7 @@ extern void Cocoa_InitModes(_THIS); extern int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); extern int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); extern void Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -extern int Cocoa_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); +extern int Cocoa_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); extern int Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); extern void Cocoa_QuitModes(_THIS); diff --git a/src/video/cocoa/SDL_cocoamodes.m b/src/video/cocoa/SDL_cocoamodes.m index 49605eec48..1abb439977 100644 --- a/src/video/cocoa/SDL_cocoamodes.m +++ b/src/video/cocoa/SDL_cocoamodes.m @@ -413,7 +413,7 @@ int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rec return 0; } -int Cocoa_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi) +int Cocoa_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi) { @autoreleasepool { const float MM_IN_INCH = 25.4f; diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m index 8e2ac5c680..9e20914175 100644 --- a/src/video/cocoa/SDL_cocoavideo.m +++ b/src/video/cocoa/SDL_cocoavideo.m @@ -81,7 +81,7 @@ static SDL_VideoDevice *Cocoa_CreateDevice(void) device->VideoQuit = Cocoa_VideoQuit; device->GetDisplayBounds = Cocoa_GetDisplayBounds; device->GetDisplayUsableBounds = Cocoa_GetDisplayUsableBounds; - device->GetDisplayDPI = Cocoa_GetDisplayDPI; + device->GetDisplayPhysicalDPI = Cocoa_GetDisplayPhysicalDPI; device->GetDisplayModes = Cocoa_GetDisplayModes; device->SetDisplayMode = Cocoa_SetDisplayMode; device->PumpEvents = Cocoa_PumpEvents; diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c index 6df2708fdd..895bedca2e 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.c +++ b/src/video/emscripten/SDL_emscriptenvideo.c @@ -39,7 +39,7 @@ static int Emscripten_VideoInit(_THIS); static int Emscripten_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); static void Emscripten_VideoQuit(_THIS); static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); -static int Emscripten_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); +static int Emscripten_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); static int Emscripten_CreateWindow(_THIS, SDL_Window *window); static void Emscripten_SetWindowSize(_THIS, SDL_Window *window); @@ -77,7 +77,7 @@ static SDL_VideoDevice *Emscripten_CreateDevice(void) device->VideoInit = Emscripten_VideoInit; device->VideoQuit = Emscripten_VideoQuit; device->GetDisplayUsableBounds = Emscripten_GetDisplayUsableBounds; - device->GetDisplayDPI = Emscripten_GetDisplayDPI; + device->GetDisplayPhysicalDPI = Emscripten_GetDisplayPhysicalDPI; device->SetDisplayMode = Emscripten_SetDisplayMode; device->PumpEvents = Emscripten_PumpEvents; @@ -170,7 +170,7 @@ static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, S return 0; } -static int Emscripten_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi_out, float *hdpi_out, float *vdpi_out) +static int Emscripten_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi_out, float *hdpi_out, float *vdpi_out) { const float dpi_reference = 96.0f; float dpi; diff --git a/src/video/uikit/SDL_uikitmodes.h b/src/video/uikit/SDL_uikitmodes.h index f8e45f84cc..54cbccc991 100644 --- a/src/video/uikit/SDL_uikitmodes.h +++ b/src/video/uikit/SDL_uikitmodes.h @@ -46,7 +46,7 @@ extern int UIKit_InitModes(_THIS); extern int UIKit_AddDisplay(UIScreen *uiscreen, SDL_bool send_event); extern void UIKit_DelDisplay(UIScreen *uiscreen); extern void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay *display); -extern int UIKit_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); +extern int UIKit_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); extern int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); extern void UIKit_QuitModes(_THIS); extern int UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index af3c9a4b5e..60ade1a8f3 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -431,7 +431,7 @@ void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay *display) } } -int UIKit_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi) +int UIKit_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi) { @autoreleasepool { SDL_DisplayData *data = (__bridge SDL_DisplayData *)display->driverdata; diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index d81d22197f..a7308b96fd 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -93,7 +93,7 @@ static SDL_VideoDevice *UIKit_CreateDevice(void) device->DestroyWindow = UIKit_DestroyWindow; device->GetWindowWMInfo = UIKit_GetWindowWMInfo; device->GetDisplayUsableBounds = UIKit_GetDisplayUsableBounds; - device->GetDisplayDPI = UIKit_GetDisplayDPI; + device->GetDisplayPhysicalDPI = UIKit_GetDisplayPhysicalDPI; device->GetWindowSizeInPixels = UIKit_GetWindowSizeInPixels; #if SDL_IPHONE_KEYBOARD diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index acf988304d..ee5762f93e 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -68,7 +68,7 @@ static int Wayland_VideoInit(_THIS); static int Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); -static int Wayland_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi); +static int Wayland_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi); static void Wayland_VideoQuit(_THIS); @@ -208,7 +208,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void) device->VideoInit = Wayland_VideoInit; device->VideoQuit = Wayland_VideoQuit; device->GetDisplayBounds = Wayland_GetDisplayBounds; - device->GetDisplayDPI = Wayland_GetDisplayDPI; + device->GetDisplayPhysicalDPI = Wayland_GetDisplayPhysicalDPI; device->GetWindowWMInfo = Wayland_GetWindowWMInfo; device->SuspendScreenSaver = Wayland_SuspendScreenSaver; @@ -972,7 +972,7 @@ static int Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect * return 0; } -static int Wayland_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi) +static int Wayland_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi) { SDL_WaylandOutputData *driverdata = (SDL_WaylandOutputData *)sdl_display->driverdata; diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index 3d1fcc79ac..1292cd2219 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -507,7 +507,7 @@ int WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) return 0; } -int WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi_out, float *hdpi_out, float *vdpi_out) +int WIN_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi_out, float *hdpi_out, float *vdpi_out) { const SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; const SDL_VideoData *videodata = (SDL_VideoData *)display->device->driverdata; diff --git a/src/video/windows/SDL_windowsmodes.h b/src/video/windows/SDL_windowsmodes.h index 39e3a3352d..be813f3aa4 100644 --- a/src/video/windows/SDL_windowsmodes.h +++ b/src/video/windows/SDL_windowsmodes.h @@ -43,7 +43,7 @@ extern void WIN_ScreenPointFromSDL(int *x, int *y, int *dpiOut); extern void WIN_ScreenPointFromSDLFloat(float x, float y, LONG *xOut, LONG *yOut, int *dpiOut); extern void WIN_ScreenPointToSDL(int *x, int *y); extern void WIN_ScreenPointToSDLFloat(LONG x, LONG y, float *xOut, float *yOut); -extern int WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); +extern int WIN_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); extern void WIN_GetDisplayModes(_THIS, SDL_VideoDisplay *display); extern int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); extern void WIN_RefreshDisplays(_THIS); diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index 318374e0c7..f235872606 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -156,7 +156,7 @@ static SDL_VideoDevice *WIN_CreateDevice(void) device->RefreshDisplays = WIN_RefreshDisplays; device->GetDisplayBounds = WIN_GetDisplayBounds; device->GetDisplayUsableBounds = WIN_GetDisplayUsableBounds; - device->GetDisplayDPI = WIN_GetDisplayDPI; + device->GetDisplayPhysicalDPI = WIN_GetDisplayPhysicalDPI; device->GetDisplayModes = WIN_GetDisplayModes; device->SetDisplayMode = WIN_SetDisplayMode; #endif diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 82b2bd1333..e046ee4cc7 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -838,7 +838,7 @@ int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect) return 0; } -int X11_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi) +int X11_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi) { SDL_DisplayData *data = (SDL_DisplayData *)sdl_display->driverdata; diff --git a/src/video/x11/SDL_x11modes.h b/src/video/x11/SDL_x11modes.h index c545479acc..1e48bccf4d 100644 --- a/src/video/x11/SDL_x11modes.h +++ b/src/video/x11/SDL_x11modes.h @@ -63,7 +63,7 @@ extern Uint32 X11_GetPixelFormatFromVisualInfo(Display *display, XVisualInfo *vinfo); extern int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect); extern int X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect); -extern int X11_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi); +extern int X11_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi); #if SDL_VIDEO_DRIVER_X11_XRANDR extern void X11_HandleXRandREvent(_THIS, const XEvent *xevent); diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 9a38836374..5a3fb4fcd9 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -215,7 +215,7 @@ static SDL_VideoDevice *X11_CreateDevice(void) device->GetDisplayModes = X11_GetDisplayModes; device->GetDisplayBounds = X11_GetDisplayBounds; device->GetDisplayUsableBounds = X11_GetDisplayUsableBounds; - device->GetDisplayDPI = X11_GetDisplayDPI; + device->GetDisplayPhysicalDPI = X11_GetDisplayPhysicalDPI; device->GetWindowICCProfile = X11_GetWindowICCProfile; device->SetDisplayMode = X11_SetDisplayMode; device->SuspendScreenSaver = X11_SuspendScreenSaver;