Minetest  5.4.0
RenderingEngine Class Reference

#include <renderingengine.h>

+ Collaboration diagram for RenderingEngine:

Public Member Functions

 RenderingEngine (IEventReceiver *eventReceiver)
 
 ~RenderingEngine ()
 
v2u32 getWindowSize () const
 
void setResizable (bool resize)
 
video::IVideoDriver * getVideoDriver ()
 
bool setupTopLevelWindow (const std::string &name)
 
void setupTopLevelXorgWindow (const std::string &name)
 
bool setWindowIcon ()
 
bool setXorgWindowIconFromPath (const std::string &icon_file)
 

Static Public Member Functions

static const char * getVideoDriverName (irr::video::E_DRIVER_TYPE type)
 
static const char * getVideoDriverFriendlyName (irr::video::E_DRIVER_TYPE type)
 
static float getDisplayDensity ()
 
static v2u32 getDisplaySize ()
 
static bool print_video_modes ()
 
static RenderingEngineget_instance ()
 
static io::IFileSystem * get_filesystem ()
 
static video::IVideoDriver * get_video_driver ()
 
static scene::IMeshCache * get_mesh_cache ()
 
static scene::ISceneManager * get_scene_manager ()
 
static irr::IrrlichtDevice * get_raw_device ()
 
static u32 get_timer_time ()
 
static gui::IGUIEnvironment * get_gui_env ()
 
static void draw_load_screen (const std::wstring &text, gui::IGUIEnvironment *guienv, ITextureSource *tsrc, float dtime=0, int percent=0, bool clouds=true)
 
static void draw_menu_scene (gui::IGUIEnvironment *guienv, float dtime, bool clouds)
 
static void draw_scene (video::SColor skycolor, bool show_hud, bool show_minimap, bool draw_wield_tool, bool draw_crosshair)
 
static void initialize (Client *client, Hud *hud)
 
static void finalize ()
 
static bool run ()
 
static std::vector< core::vector3d< u32 > > getSupportedVideoModes ()
 
static std::vector< irr::video::E_DRIVER_TYPE > getSupportedVideoDrivers ()
 

Private Member Functions

void _draw_load_screen (const std::wstring &text, gui::IGUIEnvironment *guienv, ITextureSource *tsrc, float dtime=0, int percent=0, bool clouds=true)
 
void _draw_menu_scene (gui::IGUIEnvironment *guienv, float dtime=0, bool clouds=true)
 
void _draw_scene (video::SColor skycolor, bool show_hud, bool show_minimap, bool draw_wield_tool, bool draw_crosshair)
 
void _initialize (Client *client, Hud *hud)
 
void _finalize ()
 

Private Attributes

std::unique_ptr< RenderingCorecore
 
irr::IrrlichtDevice * m_device = nullptr
 
irr::video::IVideoDriver * driver
 

Static Private Attributes

static RenderingEngines_singleton = nullptr
 

Constructor & Destructor Documentation

◆ RenderingEngine()

RenderingEngine::RenderingEngine ( IEventReceiver *  eventReceiver)

References porting::app_global, createSkin(), DIR_DELIM, driver, errorstream, g_settings, Settings::get(), Settings::getBool(), getSupportedVideoDrivers(), Settings::getU16(), getVideoDriverName(), m_device, params, porting::path_share, s_singleton, and sanity_check.

+ Here is the call graph for this function:

◆ ~RenderingEngine()

RenderingEngine::~RenderingEngine ( )

References core, m_device, and s_singleton.

Member Function Documentation

◆ _draw_load_screen()

void RenderingEngine::_draw_load_screen ( const std::wstring &  text,
gui::IGUIEnvironment *  guienv,
ITextureSource tsrc,
float  dtime = 0,
int  percent = 0,
bool  clouds = true 
)
private

References draw2DImageFilterScaled(), g_fontengine, g_menuclouds, g_menucloudsmgr, g_settings, get_instance(), get_video_driver(), Settings::getBool(), FontEngine::getLineHeight(), ITextureSource::getTexture(), FontEngine::getTextWidth(), getWindowSize(), guienv, rangelim, Clouds::render(), and Clouds::step().

Referenced by draw_load_screen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _draw_menu_scene()

void RenderingEngine::_draw_menu_scene ( gui::IGUIEnvironment *  guienv,
float  dtime = 0,
bool  clouds = true 
)
private

References g_menuclouds, g_menucloudsmgr, g_settings, get_video_driver(), Settings::getBool(), guienv, Clouds::render(), and Clouds::step().

Referenced by draw_menu_scene().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _draw_scene()

void RenderingEngine::_draw_scene ( video::SColor  skycolor,
bool  show_hud,
bool  show_minimap,
bool  draw_wield_tool,
bool  draw_crosshair 
)
private

References core.

Referenced by draw_scene().

+ Here is the caller graph for this function:

◆ _finalize()

void RenderingEngine::_finalize ( )
private

References core.

Referenced by finalize().

+ Here is the caller graph for this function:

◆ _initialize()

void RenderingEngine::_initialize ( Client client,
Hud hud 
)
private

References core, createRenderingCore(), g_settings, Settings::get(), and m_device.

Referenced by initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw_load_screen()

static void RenderingEngine::draw_load_screen ( const std::wstring &  text,
gui::IGUIEnvironment *  guienv,
ITextureSource tsrc,
float  dtime = 0,
int  percent = 0,
bool  clouds = true 
)
inlinestatic

References _draw_load_screen(), guienv, and s_singleton.

Referenced by Client::afterContentReceived(), Game::getServerContent(), Game::showOverlayMessage(), and texture_update_progress().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw_menu_scene()

static void RenderingEngine::draw_menu_scene ( gui::IGUIEnvironment *  guienv,
float  dtime,
bool  clouds 
)
inlinestatic

References _draw_menu_scene(), guienv, and s_singleton.

Referenced by Game::connectToServer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw_scene()

static void RenderingEngine::draw_scene ( video::SColor  skycolor,
bool  show_hud,
bool  show_minimap,
bool  draw_wield_tool,
bool  draw_crosshair 
)
inlinestatic

References _draw_scene(), and s_singleton.

Referenced by Game::updateFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finalize()

static void RenderingEngine::finalize ( )
inlinestatic

References _finalize(), and s_singleton.

Referenced by Game::shutdown().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_filesystem()

static io::IFileSystem* RenderingEngine::get_filesystem ( )
inlinestatic

References m_device, s_singleton, and sanity_check.

Referenced by Client::getMesh(), ModApiMainMenu::l_extract_zip(), and Client::loadMedia().

+ Here is the caller graph for this function:

◆ get_gui_env()

static gui::IGUIEnvironment* RenderingEngine::get_gui_env ( )
inlinestatic

References m_device, s_singleton, and sanity_check.

Referenced by GUIEngine::GUIEngine(), ModApiMainMenu::l_show_keys_menu(), ModApiMainMenu::l_show_path_select_dialog(), ClientLauncher::main_menu(), GUIEngine::run(), ClientLauncher::run(), and GUIEngine::updateTopLeftTextSize().

+ Here is the caller graph for this function:

◆ get_instance()

static RenderingEngine* RenderingEngine::get_instance ( )
inlinestatic

References s_singleton.

Referenced by ClientLauncher::~ClientLauncher(), _draw_load_screen(), Hud::drawHotbar(), Minimap::drawMinimap(), ModApiMainMenu::l_get_screen_info(), Hud::resizeHotbar(), ClientLauncher::run(), GameUI::setChatText(), GameUI::update(), and Camera::update().

+ Here is the caller graph for this function:

◆ get_mesh_cache()

static scene::IMeshCache* RenderingEngine::get_mesh_cache ( )
inlinestatic

References m_device, s_singleton, and sanity_check.

Referenced by Client::~Client(), Game::extendedResourceCleanup(), and Client::getMesh().

+ Here is the caller graph for this function:

◆ get_raw_device()

static irr::IrrlichtDevice* RenderingEngine::get_raw_device ( )
inlinestatic

◆ get_scene_manager()

static scene::ISceneManager* RenderingEngine::get_scene_manager ( )
inlinestatic

◆ get_timer_time()

static u32 RenderingEngine::get_timer_time ( )
inlinestatic

References m_device, s_singleton, and sanity_check.

Referenced by GUIEngine::cloudInit(), GUIEngine::cloudPostProcess(), GUIEngine::cloudPreProcess(), Game::connectToServer(), Game::getServerContent(), and Game::run().

+ Here is the caller graph for this function:

◆ get_video_driver()

◆ getDisplayDensity()

float RenderingEngine::getDisplayDensity ( )
static

References calcDisplayDensity().

Referenced by GUITable::GUITable(), Hud::Hud(), FontEngine::initFont(), FontEngine::initSimpleFont(), ModApiMainMenu::l_get_screen_info(), GUIFormSpecMenu::regenerateGui(), and Hud::resizeHotbar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDisplaySize()

v2u32 RenderingEngine::getDisplaySize ( )
static

Referenced by ModApiMainMenu::l_get_screen_info().

+ Here is the caller graph for this function:

◆ getSupportedVideoDrivers()

std::vector< irr::video::E_DRIVER_TYPE > RenderingEngine::getSupportedVideoDrivers ( )
static

Referenced by RenderingEngine(), and ModApiMainMenu::l_get_video_drivers().

+ Here is the caller graph for this function:

◆ getSupportedVideoModes()

std::vector< core::vector3d< u32 > > RenderingEngine::getSupportedVideoModes ( )
static

References sanity_check.

Referenced by ModApiMainMenu::l_get_video_modes().

+ Here is the caller graph for this function:

◆ getVideoDriver()

video::IVideoDriver* RenderingEngine::getVideoDriver ( )
inline

References driver.

◆ getVideoDriverFriendlyName()

const char * RenderingEngine::getVideoDriverFriendlyName ( irr::video::E_DRIVER_TYPE  type)
static

Referenced by ModApiMainMenu::l_get_video_drivers().

+ Here is the caller graph for this function:

◆ getVideoDriverName()

const char * RenderingEngine::getVideoDriverName ( irr::video::E_DRIVER_TYPE  type)
static

Referenced by RenderingEngine(), and ModApiMainMenu::l_get_video_drivers().

+ Here is the caller graph for this function:

◆ getWindowSize()

v2u32 RenderingEngine::getWindowSize ( ) const

References core, and m_device.

Referenced by _draw_load_screen(), Hud::drawHotbar(), Minimap::drawMinimap(), ModApiMainMenu::l_get_screen_info(), Hud::resizeHotbar(), GameUI::setChatText(), GameUI::update(), and Camera::update().

+ Here is the caller graph for this function:

◆ initialize()

static void RenderingEngine::initialize ( Client client,
Hud hud 
)
inlinestatic

References _initialize(), and s_singleton.

Referenced by Game::startup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_video_modes()

bool RenderingEngine::print_video_modes ( )
static

References _, g_settings, Settings::getBool(), Settings::getU16(), and params.

Referenced by ClientLauncher::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run()

static bool RenderingEngine::run ( )
inlinestatic

References m_device, s_singleton, and sanity_check.

Referenced by Game::connectToServer(), Game::getServerContent(), ClientLauncher::launch_game(), Game::run(), GUIEngine::run(), and ClientLauncher::run().

+ Here is the caller graph for this function:

◆ setResizable()

void RenderingEngine::setResizable ( bool  resize)

References m_device.

Referenced by ClientLauncher::run().

+ Here is the caller graph for this function:

◆ setupTopLevelWindow()

bool RenderingEngine::setupTopLevelWindow ( const std::string &  name)

References setupTopLevelXorgWindow(), setWindowIcon(), and verbosestream.

Referenced by ClientLauncher::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setupTopLevelXorgWindow()

void RenderingEngine::setupTopLevelXorgWindow ( const std::string &  name)

References driver, verbosestream, and warningstream.

Referenced by setupTopLevelWindow().

+ Here is the caller graph for this function:

◆ setWindowIcon()

bool RenderingEngine::setWindowIcon ( )

References driver, ICON_DIR, porting::path_share, PROJECT_NAME, and setXorgWindowIconFromPath().

Referenced by setupTopLevelWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setXorgWindowIconFromPath()

bool RenderingEngine::setXorgWindowIconFromPath ( const std::string &  icon_file)

References driver, m_device, and warningstream.

Referenced by setWindowIcon().

+ Here is the caller graph for this function:

Member Data Documentation

◆ core

std::unique_ptr<RenderingCore> RenderingEngine::core
private

◆ driver

irr::video::IVideoDriver* RenderingEngine::driver
private

◆ m_device

◆ s_singleton


The documentation for this class was generated from the following files: