ANDROID: Sync 3D backend HiDPI with 2D one

This commit is contained in:
Le Philousophe 2021-12-05 15:15:11 +01:00
parent f12409d321
commit 04e05e7a5f
2 changed files with 12 additions and 0 deletions

View File

@ -970,6 +970,17 @@ void AndroidGraphics3dManager::clearScreen(FixupType type, byte count) {
_force_redraw = true;
}
float AndroidGraphics3dManager::getHiDPIScreenFactor() const {
// TODO: Use JNI to get DisplayMetrics.density, which according to the documentation
// seems to be what we want.
// "On a medium-density screen, DisplayMetrics.density equals 1.0; on a high-density
// screen it equals 1.5; on an extra-high-density screen, it equals 2.0; and on a
// low-density screen, it equals 0.75. This figure is the factor by which you should
// multiply the dp units in order to get the actual pixel count for the current screen."
return 2.f;
}
AndroidCommonGraphics::State AndroidGraphics3dManager::getState() const {
AndroidCommonGraphics::State state;

View File

@ -110,6 +110,7 @@ public:
const Graphics::PixelFormat *format) override;
virtual void setCursorPalette(const byte *colors, uint start, uint num) override;
float getHiDPIScreenFactor() const override;
#ifdef USE_RGB_COLOR
virtual Graphics::PixelFormat getScreenFormat() const override;