From 2bb9d4a64dac1b3c45e8519af7005e10771533ce Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 19 Apr 2023 09:59:26 -0700 Subject: [PATCH] move PresentMode to Window and add FrameLimiterSettings to Game --- content/Game/_index.md | 14 +------------- content/Window/_index.md | 13 +++++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/content/Game/_index.md b/content/Game/_index.md index ea6852c..bb76e4b 100644 --- a/content/Game/_index.md +++ b/content/Game/_index.md @@ -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). diff --git a/content/Window/_index.md b/content/Window/_index.md index 14d132f..f436c85 100644 --- a/content/Window/_index.md +++ b/content/Window/_index.md @@ -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