You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The runtime is aware of the operating system display scaling factor
and presents a virtual coordinate space for the Lua application where it
scales the sizes and positions of the window and cursor without allowing
the application any choice. This is a hack as scaling up the window
contents by the desired amount leads to a low quality image.
In order to draw at true resolution the Lua program needs to both be
able to tell what the scaling factor is to adjust all UI dimensions, but
also able indicate to the runtime that it wishes to be free of the
virtualization and instead use the real coordinate system.
As it's a very big task both in time and design-wise to make the UI
scale the runtime needs to be able either launch in legacy mode but also
in a mode with true visuals.
This is achieved here by making `RenderInit` take a sequence of feature
flags as it's called from `Launch.lua`. This is early enough that most
of the Lua application has yet to run and thus gets the chance to fetch
the proper values as it starts up while the runtime also gets this
request early enough to influence the initialization of the renderer and
allocation of resources.
This change introduces a flag string of `"DPI_AWARE"` that instructs the
runtime to go into a mode where it reports the true scale factor in
`GetScreenScale`, provides a full-resolution render target and doesn't
rescale the screen size or mouse positions anymore.
For alternative runtimes like `pobfrontend` any flags are ignored and
their runtime continue to work as they always have, or can start
honoring the flag if it fits their environment.
# Conflicts:
# engine/render.h
# ui_api.cpp
0 commit comments