move PresentMode to Window and add FrameLimiterSettings to Game
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is failing Details

main
cosmonaut 2023-04-19 09:59:26 -07:00
parent a68d5a1ff5
commit 2bb9d4a64d
2 changed files with 14 additions and 13 deletions

View File

@ -45,19 +45,7 @@ namespace MyProject
`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.
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.
`FrameLimiterSettings` specifies your game's framerate cap. It can be set to any integer value, or uncapped.
`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).

View File

@ -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.
- `WindowHeight` is how tall the window will be.
- `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.
- `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:
```cs