#include <Settings.hpp>
|
| static bool | IsEnabled () |
| |
| static void | Enable (const bool enable=true) |
| | Set the renderer enabled state the for next client.
|
| |
| static void | Disable () |
| | Disable the rendering for all future clients.
|
| |
| static void | Headless (const bool headless=true) |
| | Make the renderer headless (hide the display window).
|
| |
| static void | ShowWindow (const bool show=true) |
| | Show/hide the rendering window.
|
| |
| static void | HideWindow () |
| | Hide the rendering window.
|
| |
| static void | SetResolution (const int width, const int height) |
| | Try to change the resolution of the rendering window. This can be limited by specific OS constraints or a user resizing the window.
|
| |
| static std::pair< int, int > | GetResolution () |
| | Get the current resolution of the renderer.
|
| |
| static void | TakeScreenshot (const std::string &path) |
| | Render and save the next rendered frame.
|
| |
| static void | TakeScreenshot (const std::function< void(const std::vector< unsigned char > &pixels, const int height, const int width)> &callback) |
| | Render the next image and pass the raw pixels to the given callback.
|
| |
| static void | EnableVsync (const bool enable=true) |
| | Enable/disable the vsync for the rendering loop.
|
| |
| static void | DisableVsync () |
| | Disable the vsync for the rendering loop.
|
| |
| static void | SetMaxFramerate (const double fps) |
| | Set the max framerate for the rendering loop. Set to 0 for no limit.
|
| |
Definition at line 12 of file Settings.hpp.
◆ Disable()
| void Botcraft::Renderer::Settings::Disable |
( |
| ) |
|
|
static |
◆ DisableVsync()
| void Botcraft::Renderer::Settings::DisableVsync |
( |
| ) |
|
|
static |
◆ Enable()
| void Botcraft::Renderer::Settings::Enable |
( |
const bool |
enable = true | ) |
|
|
static |
Set the renderer enabled state the for next client.
- Parameters
-
| enable | If true, next Client will try to create a renderer |
Definition at line 38 of file Settings.cpp.
References CHECK_GUI, and enabled.
◆ EnableVsync()
| void Botcraft::Renderer::Settings::EnableVsync |
( |
const bool |
enable = true | ) |
|
|
static |
Enable/disable the vsync for the rendering loop.
- Parameters
-
| enable | If true, vsync will be enabled |
Definition at line 96 of file Settings.cpp.
References CHECK_GUI, and vsync.
◆ GetResolution()
| std::pair< int, int > Botcraft::Renderer::Settings::GetResolution |
( |
| ) |
|
|
static |
Get the current resolution of the renderer.
- Returns
- A pair of int, { width, height }
Definition at line 77 of file Settings.cpp.
References height, and width.
◆ Headless()
| void Botcraft::Renderer::Settings::Headless |
( |
const bool |
headless = true | ) |
|
|
static |
Make the renderer headless (hide the display window).
- Parameters
-
| headless | If true, the window will be hidden (headless mode). Note that you still need some display device available to create the rendering context |
Definition at line 52 of file Settings.cpp.
References CHECK_GUI, and headless.
◆ HideWindow()
| void Botcraft::Renderer::Settings::HideWindow |
( |
| ) |
|
|
static |
◆ IsEnabled()
| bool Botcraft::Renderer::Settings::IsEnabled |
( |
| ) |
|
|
static |
◆ SetMaxFramerate()
| void Botcraft::Renderer::Settings::SetMaxFramerate |
( |
const double |
fps | ) |
|
|
static |
◆ SetResolution()
| void Botcraft::Renderer::Settings::SetResolution |
( |
const int |
width, |
|
|
const int |
height |
|
) |
| |
|
static |
Try to change the resolution of the rendering window. This can be limited by specific OS constraints or a user resizing the window.
Definition at line 70 of file Settings.cpp.
References CHECK_GUI, height, and width.
◆ ShowWindow()
| void Botcraft::Renderer::Settings::ShowWindow |
( |
const bool |
show = true | ) |
|
|
static |
Show/hide the rendering window.
- Parameters
-
| show | If true, the window will be shown, will be hidden otherwise (headless mode). Note that you still need some display device available to create the rendering context |
Definition at line 58 of file Settings.cpp.
References CHECK_GUI, and headless.
◆ TakeScreenshot() [1/2]
| static void Botcraft::Renderer::Settings::TakeScreenshot |
( |
const std::function< void(const std::vector< unsigned char > &pixels, const int height, const int width)> & |
callback | ) |
|
|
static |
Render the next image and pass the raw pixels to the given callback.
Pixels are in HWC order
- Parameters
-
| callback | Function to call with the frame raw pixels. Params are pixels, height, width |
◆ TakeScreenshot() [2/2]
| void Botcraft::Renderer::Settings::TakeScreenshot |
( |
const std::string & |
path | ) |
|
|
static |
◆ Botcraft::Renderer::RenderingManager
◆ enabled
| std::atomic< bool > Botcraft::Renderer::Settings::enabled = false |
|
staticprivate |
◆ headless
| std::atomic< bool > Botcraft::Renderer::Settings::headless = false |
|
staticprivate |
◆ height
| std::atomic< int > Botcraft::Renderer::Settings::height = 600 |
|
staticprivate |
◆ screenhsot_path
| std::string Botcraft::Renderer::Settings::screenhsot_path = "" |
|
staticprivate |
◆ screenshot_callback
| std::function< void(const std::vector< unsigned char > &pixels, const int height, const int width)> Botcraft::Renderer::Settings::screenshot_callback = nullptr |
|
staticprivate |
◆ screenshot_mutex
| std::mutex Botcraft::Renderer::Settings::screenshot_mutex |
|
staticprivate |
◆ target_fps
| std::atomic< double > Botcraft::Renderer::Settings::target_fps = 60.0 |
|
staticprivate |
◆ vsync
| std::atomic< bool > Botcraft::Renderer::Settings::vsync = true |
|
staticprivate |
◆ width
| std::atomic< int > Botcraft::Renderer::Settings::width = 800 |
|
staticprivate |
The documentation for this class was generated from the following files: