Nebula
Loading...
Searching...
No Matches
GraphicsFeature::GraphicsFeatureUnit Class Reference

#include <graphicsfeatureunit.h>

Detailed Description

Sets up the core rendering system and provides properties and managers for default usage, such as rendering models, animations, particles, etc.

Inherits Game::FeatureUnit.

Classes

struct  TerrainInstance
 

Private Types

using UIRenderFunc = std::function<void()>
 

Private Member Functions

__DeclareClass(GraphicsFeatureUnit) __DeclareSingleton(GraphicsFeatureUnit) public ~GraphicsFeatureUnit ()
 destructor
 
void OnAttach () override
 called from GameServer::AttachGameFeature()
 
void OnActivate () override
 Called upon activation of feature unit.
 
void OnDeactivate () override
 Called upon deactivation of feature unit.
 
void OnBeginFrame () override
 called on begin of frame
 
void OnBeforeViews () override
 Called before views.
 
void OnFrame () override
 called in the middle of the feature trigger cycle
 
void OnEndFrame () override
 called at the end of the feature trigger cycle
 
void OnRenderDebug () override
 called when game debug visualization is on
 
void SetWindowTitle (const Util::StringAtom &title)
 Set window title.
 
void SetGraphicsDebugging (bool value)
 Set Graphics Debugging on/off.
 
Ptr< Graphics::ViewGetDefaultView () const
 retrieve the default view
 
Ptr< Graphics::StageGetDefaultStage () const
 retrieve the default stage
 
ViewHandle GetDefaultViewHandle () const
 retrieve the default view handle
 
void SetFrameScript (IO::URI const &uri)
 set framescript. must be done before OnActivate!
 
void SetupTerrainBiome (const Terrain::BiomeSettings &biomeParameters)
 Setup terrain biome, run before OnActivate.
 
void AddRenderUICallback (UIRenderFunc func)
 add a custom UI render function
 

Private Attributes

Graphics::GraphicsEntityId globalLight
 
IO::URI defaultFrameScript
 
Util::StringAtom title
 
Ptr< Graphics::ViewdefaultView
 
Ptr< Graphics::StagedefaultStage
 
Ptr< Graphics::GraphicsServergfxServer
 
Ptr< Input::InputServerinputServer
 
CoreGraphics::WindowId wnd
 
Util::Array< UIRenderFuncuiCallbacks
 
Game::ManagerHandle graphicsManagerHandle
 
Game::ManagerHandle cameraManagerHandle
 
struct GraphicsFeature::GraphicsFeatureUnit::TerrainInstance terrain
 
ViewHandle defaultViewHandle
 
Core::CVarr_debug
 
Core::CVarr_show_frame_inspector
 

Additional Inherited Members

- Public Member Functions inherited from Game::FeatureUnit
 FeatureUnit ()
 constructor
 
virtual ~FeatureUnit ()
 destructor
 
virtual void OnRemove ()
 called from GameServer::RemoveGameFeature()
 
bool IsActive () const
 return true if featureunit is currently active
 
virtual void OnLoad (World *world)
 called from within GameServer::Load()
 
virtual void OnStart (World *world)
 called from within GameServer::OnStart() after OnLoad
 
virtual void OnSave (World *world)
 called from within GameServer::Save()
 
virtual void OnBeforeLoad (World *world)
 called from within GameServer::NotifyBeforeLoad()
 
virtual void OnBeforeCleanup (World *world)
 called from within GameServer::NotifyBeforeCleanup()
 
virtual void OnStop (World *world)
 called from withing GameServer::Stop()
 
virtual void OnDecay ()
 called after entities has been destroyed and before releasing their memory
 
virtual ManagerHandle AttachManager (ManagerAPI api)
 attach a manager to the feature unit
 
virtual void RemoveManager (ManagerHandle handle)
 remove a manager from the feature unit
 
void SetCmdLineArgs (const Util::CommandLineArgs &a)
 set command line args
 
const Util::CommandLineArgsGetCmdLineArgs () const
 get command line args
 
- Public Member Functions inherited from Core::RefCounted
 RefCounted ()
 constructor
 
int GetRefCount () const
 get the current refcount
 
void AddRef ()
 increment refcount by one
 
void Release ()
 decrement refcount and destroy object if refcount is zero
 
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
 
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
 
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
 
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
 
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
 
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
 
const Util::StringGetClassName () const
 get the class name
 
Util::FourCC GetClassFourCC () const
 get the class FourCC code
 
- Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
 
- Protected Member Functions inherited from Core::RefCounted
virtual ~RefCounted ()
 destructor (called when refcount reaches zero)
 
- Protected Attributes inherited from Game::FeatureUnit
Util::ArrayAllocator< ManagerHandle, ManagerAPImanagers
 
Ids::IdGenerationPool managerPool
 
bool active
 
Util::CommandLineArgs args
 cmdline args for configuration from cmdline
 

Member Typedef Documentation

◆ UIRenderFunc

using GraphicsFeature::GraphicsFeatureUnit::UIRenderFunc = std::function<void()>
private

Constructor & Destructor Documentation

◆ ~GraphicsFeatureUnit()

GraphicsFeature::GraphicsFeatureUnit::~GraphicsFeatureUnit ( )
private

destructor

Member Function Documentation

◆ AddRenderUICallback()

void GraphicsFeature::GraphicsFeatureUnit::AddRenderUICallback ( UIRenderFunc func)
private

add a custom UI render function

◆ GetDefaultStage()

Ptr< Graphics::Stage > GraphicsFeature::GraphicsFeatureUnit::GetDefaultStage ( ) const
inlineprivate

retrieve the default stage

◆ GetDefaultView()

Ptr< Graphics::View > GraphicsFeature::GraphicsFeatureUnit::GetDefaultView ( ) const
inlineprivate

retrieve the default view

◆ GetDefaultViewHandle()

ViewHandle GraphicsFeature::GraphicsFeatureUnit::GetDefaultViewHandle ( ) const
inlineprivate

retrieve the default view handle

◆ OnActivate()

void GraphicsFeature::GraphicsFeatureUnit::OnActivate ( )
overrideprivatevirtual

Called upon activation of feature unit.

Reimplemented from Game::FeatureUnit.

◆ OnAttach()

void GraphicsFeature::GraphicsFeatureUnit::OnAttach ( )
overrideprivatevirtual

called from GameServer::AttachGameFeature()

Reimplemented from Game::FeatureUnit.

◆ OnBeforeViews()

void GraphicsFeature::GraphicsFeatureUnit::OnBeforeViews ( )
overrideprivatevirtual

Called before views.

Reimplemented from Game::FeatureUnit.

◆ OnBeginFrame()

void GraphicsFeature::GraphicsFeatureUnit::OnBeginFrame ( )
overrideprivatevirtual

called on begin of frame

Reimplemented from Game::FeatureUnit.

◆ OnDeactivate()

void GraphicsFeature::GraphicsFeatureUnit::OnDeactivate ( )
overrideprivatevirtual

Called upon deactivation of feature unit.

Reimplemented from Game::FeatureUnit.

◆ OnEndFrame()

void GraphicsFeature::GraphicsFeatureUnit::OnEndFrame ( )
overrideprivatevirtual

called at the end of the feature trigger cycle

Reimplemented from Game::FeatureUnit.

◆ OnFrame()

void GraphicsFeature::GraphicsFeatureUnit::OnFrame ( )
overrideprivatevirtual

called in the middle of the feature trigger cycle

Reimplemented from Game::FeatureUnit.

◆ OnRenderDebug()

void GraphicsFeature::GraphicsFeatureUnit::OnRenderDebug ( )
overrideprivatevirtual

called when game debug visualization is on

Reimplemented from Game::FeatureUnit.

◆ SetFrameScript()

void GraphicsFeature::GraphicsFeatureUnit::SetFrameScript ( IO::URI const & uri)
inlineprivate

set framescript. must be done before OnActivate!

◆ SetGraphicsDebugging()

void GraphicsFeature::GraphicsFeatureUnit::SetGraphicsDebugging ( bool value)
inlineprivate

Set Graphics Debugging on/off.

◆ SetupTerrainBiome()

void GraphicsFeature::GraphicsFeatureUnit::SetupTerrainBiome ( const Terrain::BiomeSettings & biomeParameters)
private

Setup terrain biome, run before OnActivate.

◆ SetWindowTitle()

void GraphicsFeature::GraphicsFeatureUnit::SetWindowTitle ( const Util::StringAtom & title)
inlineprivate

Set window title.

Member Data Documentation

◆ cameraManagerHandle

Game::ManagerHandle GraphicsFeature::GraphicsFeatureUnit::cameraManagerHandle
private

◆ defaultFrameScript

IO::URI GraphicsFeature::GraphicsFeatureUnit::defaultFrameScript
private

◆ defaultStage

Ptr<Graphics::Stage> GraphicsFeature::GraphicsFeatureUnit::defaultStage
private

◆ defaultView

Ptr<Graphics::View> GraphicsFeature::GraphicsFeatureUnit::defaultView
private

◆ defaultViewHandle

ViewHandle GraphicsFeature::GraphicsFeatureUnit::defaultViewHandle
private

◆ gfxServer

Ptr<Graphics::GraphicsServer> GraphicsFeature::GraphicsFeatureUnit::gfxServer
private

◆ globalLight

Graphics::GraphicsEntityId GraphicsFeature::GraphicsFeatureUnit::globalLight
private

◆ graphicsManagerHandle

Game::ManagerHandle GraphicsFeature::GraphicsFeatureUnit::graphicsManagerHandle
private

◆ inputServer

Ptr<Input::InputServer> GraphicsFeature::GraphicsFeatureUnit::inputServer
private

◆ r_debug

Core::CVar* GraphicsFeature::GraphicsFeatureUnit::r_debug
private

◆ r_show_frame_inspector

Core::CVar* GraphicsFeature::GraphicsFeatureUnit::r_show_frame_inspector
private

◆ terrain

struct GraphicsFeature::GraphicsFeatureUnit::TerrainInstance GraphicsFeature::GraphicsFeatureUnit::terrain
private

◆ title

Util::StringAtom GraphicsFeature::GraphicsFeatureUnit::title
private

◆ uiCallbacks

Util::Array<UIRenderFunc> GraphicsFeature::GraphicsFeatureUnit::uiCallbacks
private

◆ wnd

CoreGraphics::WindowId GraphicsFeature::GraphicsFeatureUnit::wnd
private

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