Dynamic DPI scaling (#1980)

* DPI scaling
 1. Add the ability to query the operating system's DPI scaling values
 2. Expose those values through a new Lua function
 3. Add an asset that sets the CEF gui and the Dashboard font sizes and placements based on the DPI scaling
 4. Add that new asset into the base_blank asset
* Add message when including the dpiscaling
This commit is contained in:
Alexander Bock
2022-04-08 13:28:18 +02:00
committed by GitHub
parent 1cd84a64f7
commit 6eba57730f
6 changed files with 82 additions and 2 deletions

View File

@@ -1072,7 +1072,8 @@ scripting::LuaLibrary RenderEngine::luaLibrary() {
{
codegen::lua::AddScreenSpaceRenderable,
codegen::lua::RemoveScreenSpaceRenderable,
codegen::lua::TakeScreenshot
codegen::lua::TakeScreenshot,
codegen::lua::DpiScaling
}
};
}

View File

@@ -67,6 +67,12 @@ namespace {
return static_cast<int>(screenshotNumber);
}
// Extracts the DPI scaling for either the GUI window or if there is no dedicated GUI
// window, the first window.
[[codegen::luawrap]] float dpiScaling() {
return openspace::global::windowDelegate->osDpiScaling();
}
#include "renderengine_lua_codegen.cpp"
} // namespace