Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
RenderingEngine Class Reference

#include <renderingengine.h>

+ Collaboration diagram for RenderingEngine:

Public Member Functions

 RenderingEngine (MyEventReceiver *eventReceiver)
 
 ~RenderingEngine ()
 
void setResizable (bool resize)
 
video::IVideoDriver * getVideoDriver ()
 
bool setupTopLevelWindow ()
 
bool setWindowIcon ()
 
void cleanupMeshCache ()
 
void removeMesh (const scene::IMesh *mesh)
 
io::IFileSystem * get_filesystem ()
 
scene::ISceneManager * get_scene_manager ()
 
gui::IGUIEnvironment * get_gui_env ()
 
void draw_load_screen (const std::wstring &text, gui::IGUIEnvironment *guienv, ITextureSource *tsrc, float dtime=0, int percent=0, float *indef_pos=nullptr)
 
void draw_scene (video::SColor skycolor, bool show_hud, bool draw_wield_tool, bool draw_crosshair)
 
void initialize (Client *client, Hud *hud)
 
void finalize ()
 
bool run ()
 

Static Public Member Functions

static const VideoDriverInfogetVideoDriverInfo (irr::video::E_DRIVER_TYPE type)
 
static float getDisplayDensity ()
 
static v2u32 getWindowSize ()
 This takes 3d_mode into account - side-by-side will return a halved horizontal size.
 
static video::IVideoDriver * get_video_driver ()
 
static irr::IrrlichtDevice * get_raw_device ()
 
static ShadowRendererget_shadow_renderer ()
 
static std::vector< irr::video::E_DRIVER_TYPE > getSupportedVideoDrivers ()
 
static void autosaveScreensizeAndCo (const irr::core::dimension2d< u32 > initial_screen_size, const bool initial_window_maximized)
 
static PointerType getLastPointerType ()
 

Static Public Attributes

static const video::SColor MENU_SKY_COLOR = video::SColor(255, 140, 186, 250)
 

Private Member Functions

v2u32 _getWindowSize () const
 

Static Private Member Functions

static void settingChangedCallback (const std::string &name, void *data)
 

Private Attributes

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

Static Private Attributes

static RenderingEngines_singleton = nullptr
 

Constructor & Destructor Documentation

◆ RenderingEngine()

RenderingEngine::RenderingEngine ( MyEventReceiver * eventReceiver)

References chooseVideoDriver(), createDevice(), DIR_DELIM, driver, g_settings, Settings::get(), Settings::getBool(), Settings::getU16(), getVideoDriverName(), m_device, m_receiver, MYMAX, porting::path_share, Settings::registerChangedCallback(), s_singleton, sanity_check, settingChangedCallback(), tracestream, and verbosestream.

+ Here is the call graph for this function:

◆ ~RenderingEngine()

RenderingEngine::~RenderingEngine ( )

References core, Settings::deregisterAllChangedCallbacks(), g_settings, m_device, s_singleton, and sanity_check.

+ Here is the call graph for this function:

Member Function Documentation

◆ _getWindowSize()

v2u32 RenderingEngine::_getWindowSize ( ) const
private

References core, RenderingCore::getVirtualSize(), and m_device.

Referenced by getWindowSize().

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

◆ autosaveScreensizeAndCo()

void RenderingEngine::autosaveScreensizeAndCo ( const irr::core::dimension2d< u32 > initial_screen_size,
const bool initial_window_maximized )
static

References g_settings, get_raw_device(), get_video_driver(), Settings::getBool(), Settings::setBool(), and Settings::setU16().

Referenced by Game::run(), and GUIEngine::run().

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

◆ cleanupMeshCache()

void RenderingEngine::cleanupMeshCache ( )

References m_device.

Referenced by Client::~Client().

+ Here is the caller graph for this function:

◆ draw_load_screen()

void RenderingEngine::draw_load_screen ( const std::wstring & text,
gui::IGUIEnvironment * guienv,
ITextureSource * tsrc,
float dtime = 0,
int percent = 0,
float * indef_pos = nullptr )

References irr::gui::StaticText::add(), draw2DImageFilterScaled(), driver, g_fontengine, g_menuclouds, g_menucloudsmgr, g_settings, get_video_driver(), Settings::getBool(), getDisplayDensity(), Settings::getFloat(), FontEngine::getLineHeight(), ITextureSource::getTexture(), FontEngine::getTextWidth(), getWindowSize(), guienv, MENU_SKY_COLOR, rangelim, and Clouds::step().

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

+ 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 draw_wield_tool,
bool draw_crosshair )

References core, and RenderingCore::draw().

Referenced by Game::drawScene().

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

◆ finalize()

void RenderingEngine::finalize ( )

References core.

Referenced by Game::~Game().

+ Here is the caller graph for this function:

◆ get_filesystem()

io::IFileSystem * RenderingEngine::get_filesystem ( )
inline

References m_device.

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

+ Here is the caller graph for this function:

◆ get_gui_env()

◆ get_raw_device()

◆ get_scene_manager()

scene::ISceneManager * RenderingEngine::get_scene_manager ( )
inline

References m_device.

Referenced by Camera::Camera(), Client::getMesh(), Client::getSceneManager(), ClientLauncher::main_menu(), ClientLauncher::run(), and Game::startup().

+ Here is the caller graph for this function:

◆ get_shadow_renderer()

static ShadowRenderer * RenderingEngine::get_shadow_renderer ( )
inlinestatic

References core, RenderingCore::get_shadow_renderer(), and s_singleton.

Referenced by WieldMeshSceneNode::WieldMeshSceneNode(), GenericCAO::addToScene(), ShadowConstantSetter::onSetConstants(), GenericCAO::removeFromScene(), ClientMap::renderMap(), Client::step(), Game::updateFrame(), and Game::updateShadows().

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

◆ get_video_driver()

◆ getDisplayDensity()

float RenderingEngine::getDisplayDensity ( )
static

References g_settings, get_raw_device(), porting::getDisplayDensity(), and Settings::getFloat().

Referenced by GUIModalMenu::GUIModalMenu(), TouchControls::TouchControls(), GUIFormSpecMenu::calculateImgsize(), ClientLauncher::config_guienv(), draw_load_screen(), FontEngine::initFont(), Hud::readScalingSetting(), Hud::resizeHotbar(), and TouchControls::translateEvent().

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

◆ getLastPointerType()

static PointerType RenderingEngine::getLastPointerType ( )
inlinestatic

References MyEventReceiver::getLastPointerType(), m_receiver, s_singleton, and sanity_check.

Referenced by GUIInventoryList::draw(), Game::shouldShowTouchControls(), and GUIFormSpecMenu::showTooltip().

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

◆ getSupportedVideoDrivers()

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

References driver.

Referenced by chooseVideoDriver(), createDevice(), and ModApiMainMenu::l_get_video_drivers().

+ Here is the caller graph for this function:

◆ getVideoDriver()

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

References driver.

Referenced by ClientLauncher::run().

+ Here is the caller graph for this function:

◆ getVideoDriverInfo()

const VideoDriverInfo & RenderingEngine::getVideoDriverInfo ( irr::video::E_DRIVER_TYPE type)
static

Referenced by chooseVideoDriver(), getVideoDriverName(), ModApiMainMenu::l_get_active_driver(), and ModApiMainMenu::l_get_video_drivers().

+ Here is the caller graph for this function:

◆ getWindowSize()

static v2u32 RenderingEngine::getWindowSize ( )
inlinestatic

This takes 3d_mode into account - side-by-side will return a halved horizontal size.

Returns
"window" size

References _getWindowSize(), s_singleton, and sanity_check.

Referenced by draw_load_screen(), Hud::drawHotbar(), Hud::resizeHotbar(), Camera::update(), GameUI::update(), and GameUI::updateChatSize().

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

◆ initialize()

void RenderingEngine::initialize ( Client * client,
Hud * hud )

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

Referenced by Game::startup().

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

◆ removeMesh()

void RenderingEngine::removeMesh ( const scene::IMesh * mesh)

References m_device.

Referenced by Client::getMesh().

+ Here is the caller graph for this function:

◆ run()

bool RenderingEngine::run ( )
inline

References m_device.

Referenced by Game::connectToServer(), Game::createSingleplayerServer(), Client::drawLoadScreen(), Game::getServerContent(), ClientLauncher::launch_game(), ClientLauncher::main_menu(), ClientLauncher::run(), Game::run(), GUIEngine::run(), and Game::shutdown().

+ 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:

◆ settingChangedCallback()

void RenderingEngine::settingChangedCallback ( const std::string & name,
void * data )
staticprivate

References g_settings, Settings::getBool(), and m_device.

Referenced by RenderingEngine().

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

◆ setupTopLevelWindow()

bool RenderingEngine::setupTopLevelWindow ( )

References setWindowIcon().

Referenced by ClientLauncher::run().

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

◆ setWindowIcon()

bool RenderingEngine::setWindowIcon ( )

References driver, m_device, porting::path_share, and warningstream.

Referenced by setupTopLevelWindow().

+ 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

◆ m_receiver

MyEventReceiver* RenderingEngine::m_receiver = nullptr
private

◆ MENU_SKY_COLOR

const video::SColor RenderingEngine::MENU_SKY_COLOR = video::SColor(255, 140, 186, 250)
static

Referenced by draw_load_screen(), and GUIEngine::run().

◆ s_singleton


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