107template<
typename T>
const Ptr<T>&
111 IndexT index = this->FindPlugin(rtti);
112 return this->plugins[index].downcast<T>();
The common base class of Nebula.
Definition refcounted.h:38
Nebula's runtime type information for one class.
Definition rtti.h:27
bool IsDerivedFrom(const Rtti &other) const
return true if this rtti is equal or derived from to other rtti
Definition rtti.cc:135
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
The central registry for render thread plugins.
Definition rtpluginregistry.h:19
IndexT FindPlugin(const Core::Rtti *rtti) const
find plugin index by rtti
Definition rtpluginregistry.cc:99
virtual void OnUpdateAfter(IndexT frameId, Timing::Time time)
called after updating entities
Definition rtpluginregistry.cc:219
virtual void OnDiscardStage(const Ptr< Graphics::Stage > &stage)
called when a stage is discarded
Definition rtpluginregistry.cc:135
virtual void OnFrameAfter(IndexT frameId, Timing::Time time)
called at the end of frame
Definition rtpluginregistry.cc:289
__DeclareSingleton(RTPluginRegistry)
void RegisterRTPlugin(const Core::Rtti *rtti)
register a render plugin
Definition rtpluginregistry.cc:66
virtual void OnAttachEntity(const Ptr< Graphics::GraphicsEntity > &entity)
called when a graphics entity has been registered with the GraphicsServer
Definition rtpluginregistry.cc:177
virtual void OnUpdateBefore(IndexT frameId, Timing::Time time)
called before updating entities
Definition rtpluginregistry.cc:205
virtual void OnRender(const Util::StringAtom &filter)
called from a frame script
Definition rtpluginregistry.cc:261
virtual void OnFrameBefore(IndexT frameId, Timing::Time time)
called at the beginning of frame
Definition rtpluginregistry.cc:275
void Discard()
discard the plugin registry
Definition rtpluginregistry.cc:48
virtual void OnRenderBefore(IndexT frameId, Timing::Time time)
called before rendering entities
Definition rtpluginregistry.cc:233
void UnregisterRTPlugin(const Core::Rtti *rtti)
unregister a render plugin
Definition rtpluginregistry.cc:83
bool isValid
Definition rtpluginregistry.h:83
virtual void OnRenderWithoutView(IndexT frameId, Timing::Time time)
called if no view exists, and no default camera is set in view
Definition rtpluginregistry.cc:316
virtual ~RTPluginRegistry()
destructor
Definition rtpluginregistry.cc:28
virtual void OnRenderFrame()
called from when rendering with a special tag
Definition rtpluginregistry.cc:302
virtual void OnStageCreated(const Ptr< Graphics::Stage > &stage)
called when a new stage has been created
Definition rtpluginregistry.cc:121
__DeclareClass(RTPluginRegistry)
bool IsValid() const
return true if currently valid
Definition rtpluginregistry.h:90
virtual void OnDiscardView(const Ptr< Graphics::View > &view)
called when a view is being discarded
Definition rtpluginregistry.cc:163
Util::Array< Ptr< RTPlugin > > plugins
Definition rtpluginregistry.h:82
virtual void OnViewCreated(const Ptr< Graphics::View > &view)
called when a new view has been created
Definition rtpluginregistry.cc:149
const Ptr< T > & GetPluginByRTTI(const Core::Rtti *rtti) const
get plugin by rtti
void Setup()
setup the plugin registry
Definition rtpluginregistry.cc:38
RTPluginRegistry()
constructor
Definition rtpluginregistry.cc:19
virtual void OnWindowResized(IndexT windowId, SizeT width, SizeT height)
called if the window has been resized
Definition rtpluginregistry.cc:330
const Util::Array< Ptr< RTPlugin > > & GetRTPlugins() const
get all currently registered plugins
Definition rtpluginregistry.h:99
virtual void OnRenderAfter(IndexT frameId, Timing::Time time)
called after rendering entities
Definition rtpluginregistry.cc:247
virtual void OnRemoveEntity(const Ptr< Graphics::GraphicsEntity > &entity)
called when a graphics entity is being removed from a stage
Definition rtpluginregistry.cc:191
Nebula's dynamic array class.
Definition array.h:60
A StringAtom.
Definition stringatom.h:22
#define n_assert(exp)
Definition debug.h:50
Definition rendermodule.cc:11
double Time
the time datatype
Definition time.h:18
int SizeT
Definition types.h:49
int IndexT
Definition types.h:48