move PresentMode to Window and add FrameLimiterSettings to Game
parent
a68d5a1ff5
commit
2bb9d4a64d
|
@ -45,19 +45,7 @@ namespace MyProject
|
||||||
|
|
||||||
`WindowCreateInfo` is discussed in the Window section.
|
`WindowCreateInfo` is discussed in the Window section.
|
||||||
|
|
||||||
`PresentMode` refers to the way that your game's render is presented to the screen. The differences and trade-offs boil down to visible tearing vs latency.
|
`FrameLimiterSettings` specifies your game's framerate cap. It can be set to any integer value, or uncapped.
|
||||||
|
|
||||||
The two modes that allow tearing are `Immediate` and `FIFORelaxed`.
|
|
||||||
|
|
||||||
`Immediate` means that the presentation system does not wait for vertical refresh to update the screen and presents the image as soon as possible.
|
|
||||||
|
|
||||||
`FIFORelaxed` means that the presentation system *usually* waits for vertical refresh to update the screen, but if a vertical refresh period has passed since the last screen update then the presentation system does not wait for a new one.
|
|
||||||
|
|
||||||
The two modes that do not allow tearing are Mailbox and FIFO.
|
|
||||||
|
|
||||||
`Mailbox` means that the presentation system waits for vertical refresh to update the screen. A queue is used to hold presentation requests, and if the queue is full, then an existing entry is replaced in the queue. This allows for low latency while still preventing tearing. The drawback is that this presentation mode is often not supported on non-Linux systems or older hardware.
|
|
||||||
|
|
||||||
`FIFO` means that the presentation system waits for vertical refresh to update the screen, and new requests are appended to the end of a queue. This mode is required to be supported by the device and prevents screen tearing, but the latency may be slightly worse than the alternatives.
|
|
||||||
|
|
||||||
`timestep` refers to units of frames-per-second. Passing a timestep of 60 means that your game's logic will always update with an exact timestep of (1/60).
|
`timestep` refers to units of frames-per-second. Passing a timestep of 60 means that your game's logic will always update with an exact timestep of (1/60).
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,22 @@ Your game is assumed to have a window and you must pass a `WindowCreateInfo` str
|
||||||
- `WindowWidth` is how wide the window will be.
|
- `WindowWidth` is how wide the window will be.
|
||||||
- `WindowHeight` is how tall the window will be.
|
- `WindowHeight` is how tall the window will be.
|
||||||
- `ScreenMode` determines whether the window will be created in windowed mode, fullscreen, or borderless fullscreen.
|
- `ScreenMode` determines whether the window will be created in windowed mode, fullscreen, or borderless fullscreen.
|
||||||
|
`PresentMode` refers to the way that your game's render is presented to the screen.
|
||||||
- `SystemResizable` specifies if the user will be able to resize the window by clicking and dragging the corners.
|
- `SystemResizable` specifies if the user will be able to resize the window by clicking and dragging the corners.
|
||||||
- `StartMaximized` specifies if the window will open at the maximum desktop resolution.
|
- `StartMaximized` specifies if the window will open at the maximum desktop resolution.
|
||||||
|
|
||||||
|
`PresentMode` has two modes that allow tearing: `Immediate` and `FIFORelaxed`.
|
||||||
|
|
||||||
|
`Immediate` means that the presentation system does not wait for vertical refresh to update the screen and presents the image as soon as possible.
|
||||||
|
|
||||||
|
`FIFORelaxed` means that the presentation system *usually* waits for vertical refresh to update the screen, but if a vertical refresh period has passed since the last screen update then the presentation system does not wait for a new one.
|
||||||
|
|
||||||
|
The two modes that do not allow tearing are Mailbox and FIFO.
|
||||||
|
|
||||||
|
`Mailbox` means that the presentation system waits for vertical refresh to update the screen. A queue is used to hold presentation requests, and if the queue is full, then an existing entry is replaced in the queue. This allows for low latency while still preventing tearing. The drawback is that this presentation mode is often not supported on non-Linux systems or older hardware.
|
||||||
|
|
||||||
|
`FIFO` means that the presentation system waits for vertical refresh to update the screen, and new requests are appended to the end of a queue. This mode is required to be supported by the device and prevents screen tearing, but the latency may be slightly worse than the alternatives.
|
||||||
|
|
||||||
You can change the screen mode at runtime with the `SetScreenMode` method:
|
You can change the screen mode at runtime with the `SetScreenMode` method:
|
||||||
|
|
||||||
```cs
|
```cs
|
||||||
|
|
Loading…
Reference in New Issue