11 static bool settings_first_time =
true;
12#define CHECK_GUI if (settings_first_time) { LOG_WARNING("Botcraft compiled without UI support. Rendering function call ignored. Recompile with BOTCRAFT_USE_GUI to enable GUI support."); } settings_first_time = false
14 #define CHECK_GUI static_assert(true, "requires ; after call")
34 return enabled.load(std::memory_order_relaxed);
89 void Settings::TakeScreenshot(
const std::function<
void(
const std::vector<unsigned char>&,
const int,
const int)>& callback)
static void SetMaxFramerate(const double fps)
Set the max framerate for the rendering loop. Set to 0 for no limit.
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 ...
static std::string screenhsot_path
static void Enable(const bool enable=true)
Set the renderer enabled state the for next client.
static void TakeScreenshot(const std::string &path)
Render and save the next rendered frame.
static void HideWindow()
Hide the rendering window.
static void DisableVsync()
Disable the vsync for the rendering loop.
static std::mutex screenshot_mutex
static std::function< void(const std::vector< unsigned char > &pixels, const int height, const int width)> screenshot_callback
static std::atomic< bool > enabled
static void ShowWindow(const bool show=true)
Show/hide the rendering window.
static void EnableVsync(const bool enable=true)
Enable/disable the vsync for the rendering loop.
static std::atomic< int > height
static std::atomic< bool > vsync
static void Headless(const bool headless=true)
Make the renderer headless (hide the display window).
static std::atomic< int > width
static std::atomic< bool > headless
static std::pair< int, int > GetResolution()
Get the current resolution of the renderer.
static std::atomic< double > target_fps
static void Disable()
Disable the rendering for all future clients.