mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-01 09:08:49 -06:00
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:
@@ -1072,7 +1072,8 @@ scripting::LuaLibrary RenderEngine::luaLibrary() {
|
||||
{
|
||||
codegen::lua::AddScreenSpaceRenderable,
|
||||
codegen::lua::RemoveScreenSpaceRenderable,
|
||||
codegen::lua::TakeScreenshot
|
||||
codegen::lua::TakeScreenshot,
|
||||
codegen::lua::DpiScaling
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user