Allolib  1.0
C++ Components For Interactive Multimedia
al::DistributedAppWithState< TSharedState > Class Template Reference

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/app/al_DistributedApp.hpp>

Inheritance diagram for al::DistributedAppWithState< TSharedState >:
al::DistributedApp al::App al::NodeConfiguration

Public Member Functions

TSharedState & state ()
 
void start () override
 
std::string name ()
 
virtual void prepare ()
 prepares domains and configuration More...
 
void registerDynamicScene (DynamicScene &scene)
 
Graphicsgraphics () override
 
WindowdefaultWindow () override
 
Viewpointview () override
 
Posepose () override
 
Lenslens () override
 
Navnav () override
 
NavInputControlnavControl () override
 
template<class DomainType >
std::shared_ptr< DomainType > newDomain ()
 
virtual void onInit ()
 
virtual void onCreate ()
 
virtual void onAnimate (double dt)
 
virtual void onDraw (Graphics &g)
 
virtual void onSound (AudioIOData &io)
 
virtual void onMessage (osc::Message &m)
 
virtual void onExit ()
 
virtual bool onKeyDown (Keyboard const &)
 
virtual bool onKeyUp (Keyboard const &)
 
virtual bool onMouseDown (Mouse const &)
 
virtual bool onMouseUp (Mouse const &)
 
virtual bool onMouseDrag (Mouse const &)
 
virtual bool onMouseMove (Mouse const &)
 
virtual bool onMouseScroll (Mouse const &)
 
virtual void onResize (int, int)
 
void quit ()
 Requests domain to quit.
 
bool shouldQuit ()
 
void fps (double f)
 
Keyboardkeyboard ()
 Get current keyboard state.
 
Mousemouse ()
 Get current mouse state.
 
double aspect ()
 Get aspect ratio (width divided by height)
 
bool created ()
 
Window::Cursor cursor ()
 Get current cursor type.
 
void cursor (Window::Cursor v)
 Set cursor type.
 
bool cursorHide ()
 Whether the cursor is hidden.
 
void cursorHide (bool v)
 Set cursor hiding.
 
Window::Dim dimensions ()
 Get current dimensions of window.
 
void dimensions (const Window::Dim &v)
 Set dimensions.
 
void dimensions (int w, int h)
 Set dimensions.
 
void dimensions (int x, int y, int w, int h)
 Set dimensions.
 
Window::DisplayMode displayMode ()
 Get current display mode.
 
void displayMode (Window::DisplayMode v)
 
bool enabled (Window::DisplayMode v)
 Get whether display mode flag is set.
 
bool fullScreen ()
 Get whether window is in fullscreen.
 
void fullScreen (bool on)
 
const std::string & title ()
 Get title of window.
 
void title (const std::string &v)
 Set title.
 
bool visible ()
 Get whether window is visible.
 
bool vsync ()
 Get whether v-sync is enabled.
 
void vsync (bool v)
 
void fullScreenToggle ()
 Toggle fullscreen.
 
void hide ()
 Hide window (if showing)
 
void iconify ()
 Iconify window.
 
int height ()
 Get window height, in pixels.
 
int width ()
 Get window width, in pixels.
 
int fbHeight ()
 
int fbWidth ()
 
float highresFactor ()
 
bool decorated ()
 
void decorated (bool b)
 
void cursorHideToggle ()
 Toggle cursor hiding.
 
void append (WindowEventHandler &handler)
 
void prepend (WindowEventHandler &handler)
 
void remove (WindowEventHandler &handler)
 
AudioIOaudioIO ()
 
void configureAudio (double audioRate=44100, int audioBlockSize=512, int audioOutputs=-1, int audioInputs=-1)
 
void configureAudio (AudioDevice &dev, double audioRate=-1, int audioBlockSize=512, int audioOutputs=-1, int audioInputs=-1)
 
ParameterServerparameterServer ()
 
std::shared_ptr< OSCDomainoscDomain ()
 
std::shared_ptr< AudioDomainaudioDomain ()
 
std::shared_ptr< OpenGLGraphicsDomaingraphicsDomain ()
 
std::shared_ptr< SimulationDomainsimulationDomain ()
 
std::shared_ptr< GLFWOpenGLWindowDomaindefaultWindowDomain ()
 
bool hasCapability (Capability cap)
 
bool isPrimary ()
 
void setRole (std::string role)
 

Public Attributes

std::shared_ptr< GLFWOpenGLOmniRendererDomainomniRendering
 
std::map< std::string, std::string > additionalConfig
 
StandardWindowAppKeyControls stdControls
 
std::shared_ptr< GLFWOpenGLWindowDomainmDefaultWindowDomain
 
std::shared_ptr< OSCDomainmOSCDomain
 
std::shared_ptr< AudioDomainmAudioDomain
 
std::shared_ptr< OpenGLGraphicsDomainmOpenGLGraphicsDomain
 
std::shared_ptr< SimulationDomainmSimulationDomain
 
uint16_t rank {0}
 
uint16_t group {0}
 
std::string dataRoot
 
Capability mCapabilites {CAP_NONE}
 

Protected Member Functions

void initializeDomains ()
 

Protected Attributes

std::vector< std::shared_ptr< AsynchronousDomain > > mDomainList
 
std::stack< std::shared_ptr< AsynchronousDomain > > mRunningDomains
 

Detailed Description

template<class TSharedState>
class al::DistributedAppWithState< TSharedState >

Provides a class to ditribute synchronous state. By default, OSC blobs are used which are currently limited in size by the osc library, so it wil fail even with small states. If cuttlebone is available through al_ext/stateditribution you can have this app use cuttlebone instead.

If you are feeling adventurous, you can modify oscpack to allow larger packet buffer.

Currently, the state simulation domain is injected as a subdomain of the graphics domain i.e. it runs synchronously to graphics domain, calling onAnimate() within the graphics loop. This architure will allow running onAnimate() on a separate thrad if desired.

Definition at line 124 of file al_DistributedApp.hpp.

Member Function Documentation

◆ created()

bool al::App::created ( )
inherited

Whether window has been created providing a valid graphics context

◆ displayMode()

void al::App::displayMode ( Window::DisplayMode  v)
inherited

Set display mode; will recreate window if different from current

◆ fullScreen()

void al::App::fullScreen ( bool  on)
inherited

This will make the window go fullscreen without borders and, if posssible, without changing the display resolution.

◆ prepare()

virtual void al::DistributedApp::prepare ( )
virtualinherited

prepares domains and configuration

You can run this function manually to change domain behavior before the domains are actually started, for example to disable state sharing on a primary application.

◆ vsync()

void al::App::vsync ( bool  v)
inherited

Set whether to sync the frame rate to the monitor's refresh rate


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