Renderer · class
ResolutionGovernor
Explained in Hello world.
class ResolutionGovernorimport { ResolutionGovernor } from '@driftengine/core';Constructor
new
constructor(ceiling: number, limits?: Partial<GovernorLimits>)| Parameter | Type | Description |
|---|---|---|
ceiling | number | |
limits? | Partial<GovernorLimits> |
Accessors
| Name | Type | Description |
|---|---|---|
scaleget | number |
Methods
setCeiling
setCeiling(ceiling: number): voidThe player's own ceiling moved.
| Parameter | Type | Description |
|---|---|---|
ceiling | number |
More
A lower ceiling applies at once, because their choice is authority and waiting a window to honour it would be ignoring them. A higher one is only a permission: it does not raise the current scale, because jumping up would undo a drop the device had already earned. The patience path decides whether it can afford to climb back.
reset
reset(): voidStart the window again, leaving the scale where it is.
sample
sample(frameMs: number, playable: boolean): number | nullOne frame. Returns the new scale when it changed and null when it did not, so the
caller does no GL or DOM work on an ordinary frame.
| Parameter | Type | Description |
|---|---|---|
frameMs | number | |
playable | boolean |
More
playable exists because of DZTF9F, where an RTX 3060 filed a report calling
itself unplayable from a menu: a menu frame and a hidden-tab frame are not verdicts
about the machine. A governor that believed them would soften a game running
perfectly, which is the same false positive with a more visible symptom.