RigsofRods
Soft-body Physics Simulation
Public Member Functions | Private Member Functions | Private Attributes
RoR::AppContext Class Reference

Central setup and event handler for input/windowing/rendering. More...

#include <AppContext.h>

+ Inheritance diagram for RoR::AppContext:
+ Collaboration diagram for RoR::AppContext:

Public Member Functions

void SetUpThreads ()
 
bool SetUpProgramPaths ()
 
void SetUpLogging ()
 
bool SetUpResourcesDir ()
 
bool SetUpRendering ()
 
bool SetUpConfigSkeleton ()
 
bool SetUpInput ()
 
void SetUpObsoleteConfMarker ()
 
Ogre::RenderWindow * CreateCustomRenderWindow (std::string const &name, int width, int height)
 
void CaptureScreenshot ()
 
void ActivateFullscreen (bool val)
 
Ogre::Root * GetOgreRoot ()
 
Ogre::Viewport * GetViewport ()
 
Ogre::RenderWindow * GetRenderWindow ()
 
RoR::ForceFeedbackGetForceFeedback ()
 
std::thread::id GetMainThreadID ()
 

Private Member Functions

virtual void windowResized (Ogre::RenderWindow *rw) override
 
virtual void windowFocusChange (Ogre::RenderWindow *rw) override
 
virtual bool mouseMoved (const OIS::MouseEvent &arg) override
 
virtual bool mousePressed (const OIS::MouseEvent &arg, OIS::MouseButtonID id) override
 
virtual bool mouseReleased (const OIS::MouseEvent &arg, OIS::MouseButtonID id) override
 
virtual bool keyPressed (const OIS::KeyEvent &arg) override
 
virtual bool keyReleased (const OIS::KeyEvent &arg) override
 
virtual bool buttonPressed (const OIS::JoyStickEvent &arg, int button) override
 
virtual bool buttonReleased (const OIS::JoyStickEvent &arg, int button) override
 
virtual bool axisMoved (const OIS::JoyStickEvent &arg, int axis) override
 
virtual bool sliderMoved (const OIS::JoyStickEvent &arg, int) override
 
virtual bool povMoved (const OIS::JoyStickEvent &arg, int) override
 
void SetRenderWindowIcon (Ogre::RenderWindow *rw)
 

Private Attributes

Ogre::Root * m_ogre_root = nullptr
 
Ogre::RenderWindow * m_render_window = nullptr
 
Ogre::Viewport * m_viewport = nullptr
 
bool m_windowed_fix = false
 Workaround OGRE glitch when switching from fullscreen. More...
 
std::time_t m_prev_screenshot_time
 
int m_prev_screenshot_index = 1
 
RoR::ForceFeedback m_force_feedback
 
std::thread::id m_mainthread_id
 

Detailed Description

Central setup and event handler for input/windowing/rendering.

Inspired by OgreBites::ApplicationContext.

Definition at line 43 of file AppContext.h.

Member Function Documentation

◆ ActivateFullscreen()

void AppContext::ActivateFullscreen ( bool  val)

Definition at line 438 of file AppContext.cpp.

+ Here is the caller graph for this function:

◆ axisMoved()

bool AppContext::axisMoved ( const OIS::JoyStickEvent &  arg,
int  axis 
)
overrideprivatevirtual

Definition at line 170 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ buttonPressed()

bool AppContext::buttonPressed ( const OIS::JoyStickEvent &  arg,
int  button 
)
overrideprivatevirtual

Definition at line 168 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ buttonReleased()

bool AppContext::buttonReleased ( const OIS::JoyStickEvent &  arg,
int  button 
)
overrideprivatevirtual

Definition at line 169 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ CaptureScreenshot()

void AppContext::CaptureScreenshot ( )

Definition at line 391 of file AppContext.cpp.

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

◆ CreateCustomRenderWindow()

Ogre::RenderWindow * AppContext::CreateCustomRenderWindow ( std::string const &  name,
int  width,
int  height 
)

Definition at line 381 of file AppContext.cpp.

+ Here is the caller graph for this function:

◆ GetForceFeedback()

RoR::ForceFeedback& RoR::AppContext::GetForceFeedback ( )
inline

Definition at line 68 of file AppContext.h.

+ Here is the caller graph for this function:

◆ GetMainThreadID()

std::thread::id RoR::AppContext::GetMainThreadID ( )
inline

Definition at line 69 of file AppContext.h.

◆ GetOgreRoot()

Ogre::Root* RoR::AppContext::GetOgreRoot ( )
inline

Definition at line 65 of file AppContext.h.

+ Here is the caller graph for this function:

◆ GetRenderWindow()

Ogre::RenderWindow* RoR::AppContext::GetRenderWindow ( )
inline

Definition at line 67 of file AppContext.h.

+ Here is the caller graph for this function:

◆ GetViewport()

Ogre::Viewport* RoR::AppContext::GetViewport ( )
inline

Definition at line 66 of file AppContext.h.

+ Here is the caller graph for this function:

◆ keyPressed()

bool AppContext::keyPressed ( const OIS::KeyEvent &  arg)
overrideprivatevirtual

Definition at line 137 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ keyReleased()

bool AppContext::keyReleased ( const OIS::KeyEvent &  arg)
overrideprivatevirtual

Definition at line 150 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ mouseMoved()

bool AppContext::mouseMoved ( const OIS::MouseEvent &  arg)
overrideprivatevirtual

Definition at line 76 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ mousePressed()

bool AppContext::mousePressed ( const OIS::MouseEvent &  arg,
OIS::MouseButtonID  id 
)
overrideprivatevirtual

Definition at line 96 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ mouseReleased()

bool AppContext::mouseReleased ( const OIS::MouseEvent &  arg,
OIS::MouseButtonID  id 
)
overrideprivatevirtual

Definition at line 117 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ povMoved()

bool AppContext::povMoved ( const OIS::JoyStickEvent &  arg,
int   
)
overrideprivatevirtual

Definition at line 172 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ SetRenderWindowIcon()

void AppContext::SetRenderWindowIcon ( Ogre::RenderWindow *  rw)
private

Definition at line 200 of file AppContext.cpp.

+ Here is the caller graph for this function:

◆ SetUpConfigSkeleton()

bool AppContext::SetUpConfigSkeleton ( )

Definition at line 538 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ SetUpInput()

bool AppContext::SetUpInput ( )

Definition at line 62 of file AppContext.cpp.

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

◆ SetUpLogging()

void AppContext::SetUpLogging ( )

Definition at line 504 of file AppContext.cpp.

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

◆ SetUpObsoleteConfMarker()

void AppContext::SetUpObsoleteConfMarker ( )

Definition at line 582 of file AppContext.cpp.

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

◆ SetUpProgramPaths()

bool AppContext::SetUpProgramPaths ( )

Definition at line 456 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ SetUpRendering()

bool AppContext::SetUpRendering ( )

Definition at line 219 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ SetUpResourcesDir()

bool AppContext::SetUpResourcesDir ( )

Definition at line 520 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ SetUpThreads()

void AppContext::SetUpThreads ( )

Definition at line 614 of file AppContext.cpp.

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

◆ sliderMoved()

bool AppContext::sliderMoved ( const OIS::JoyStickEvent &  arg,
int   
)
overrideprivatevirtual

Definition at line 171 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ windowFocusChange()

void AppContext::windowFocusChange ( Ogre::RenderWindow *  rw)
overrideprivatevirtual

Definition at line 187 of file AppContext.cpp.

+ Here is the call graph for this function:

◆ windowResized()

void AppContext::windowResized ( Ogre::RenderWindow *  rw)
overrideprivatevirtual

Definition at line 174 of file AppContext.cpp.

+ Here is the call graph for this function:

Field Documentation

◆ m_force_feedback

RoR::ForceFeedback RoR::AppContext::m_force_feedback
private

Definition at line 105 of file AppContext.h.

◆ m_mainthread_id

std::thread::id RoR::AppContext::m_mainthread_id
private

Definition at line 107 of file AppContext.h.

◆ m_ogre_root

Ogre::Root* RoR::AppContext::m_ogre_root = nullptr
private

Definition at line 97 of file AppContext.h.

◆ m_prev_screenshot_index

int RoR::AppContext::m_prev_screenshot_index = 1
private

Definition at line 103 of file AppContext.h.

◆ m_prev_screenshot_time

std::time_t RoR::AppContext::m_prev_screenshot_time
private

Definition at line 102 of file AppContext.h.

◆ m_render_window

Ogre::RenderWindow* RoR::AppContext::m_render_window = nullptr
private

Definition at line 98 of file AppContext.h.

◆ m_viewport

Ogre::Viewport* RoR::AppContext::m_viewport = nullptr
private

Definition at line 99 of file AppContext.h.

◆ m_windowed_fix

bool RoR::AppContext::m_windowed_fix = false
private

Workaround OGRE glitch when switching from fullscreen.

Definition at line 100 of file AppContext.h.


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