@@ -460,17 +460,21 @@ int GetMonitorHeight(int monitor)
460
460
}
461
461
462
462
// Get selected monitor physical width in millimetres
463
+ // NOTE: It seems to return a slightly underestimated value on some devices
463
464
int GetMonitorPhysicalWidth (int monitor )
464
465
{
465
- TRACELOG (LOG_WARNING , "GetMonitorPhysicalWidth() not implemented on target platform" );
466
- return 0 ;
466
+ int widthPixels = ANativeWindow_getWidth (platform .app -> window );
467
+ float dpi = AConfiguration_getDensity (platform .app -> config );
468
+ return (widthPixels /dpi )* 25.4f ;
467
469
}
468
470
469
471
// Get selected monitor physical height in millimetres
472
+ // NOTE: It seems to return a slightly underestimated value on some devices
470
473
int GetMonitorPhysicalHeight (int monitor )
471
474
{
472
- TRACELOG (LOG_WARNING , "GetMonitorPhysicalHeight() not implemented on target platform" );
473
- return 0 ;
475
+ int heightPixels = ANativeWindow_getHeight (platform .app -> window );
476
+ float dpi = AConfiguration_getDensity (platform .app -> config );
477
+ return (heightPixels /dpi )* 25.4f ;
474
478
}
475
479
476
480
// Get selected monitor refresh rate
@@ -497,8 +501,9 @@ Vector2 GetWindowPosition(void)
497
501
// Get window scale DPI factor for current monitor
498
502
Vector2 GetWindowScaleDPI (void )
499
503
{
500
- TRACELOG (LOG_WARNING , "GetWindowScaleDPI() not implemented on target platform" );
501
- return (Vector2 ){ 1.0f , 1.0f };
504
+ int density = AConfiguration_getDensity (platform .app -> config );
505
+ float scale = (float )density /160 ;
506
+ return (Vector2 ){ scale , scale };
502
507
}
503
508
504
509
// Set clipboard text content
0 commit comments