Nebula
Loading...
Searching...
No Matches
Graphics::GraphicsServer Class Reference

#include <graphicsserver.h>

Detailed Description

The graphics server is the main singleton for the Graphics subsystem.

Updating the GraphicsServer will progress the rendering process by one frame.

Inherits Core::RefCounted.

Public Member Functions

 GraphicsServer ()
 constructor
 
virtual ~GraphicsServer ()
 destructor
 
void Open ()
 opens the graphics server
 
void Close ()
 closes the graphics server
 
GraphicsEntityId CreateGraphicsEntity ()
 create graphics entity
 
void DiscardGraphicsEntity (const GraphicsEntityId id)
 discard graphics entity
 
bool IsValidGraphicsEntity (const GraphicsEntityId id)
 check if graphics entity is valid
 
Ptr< ViewCreateView (const Util::StringAtom &name, const IO::URI &framescript, const CoreGraphics::WindowId window=CoreGraphics::InvalidWindowId)
 create a new view with a new framescript
 
Ptr< ViewCreateView (const Util::StringAtom &name)
 create a new view without a framescript
 
void DiscardView (const Ptr< View > &view)
 discard view
 
const Ptr< View > & GetCurrentView () const
 get current view
 
void SetCurrentView (const Ptr< View > &view)
 set current view (do not use unless you know what you are doing since this is normally handled by the graphicssserver)
 
Ptr< StageCreateStage (const Util::StringAtom &name, bool main)
 create a new stage
 
void DiscardStage (const Ptr< Stage > &stage)
 discard stage
 
void SetupPreLogicCalls (const Util::Array< ViewIndependentCall > &calls)
 Setup pre game logic graphics calls.
 
void SetupPostLogicCalls (const Util::Array< ViewIndependentCall > &calls)
 Setup post game logic graphics calls.
 
void SetupPreLogicViewCalls (const Util::Array< ViewDependentCall > &calls)
 Setup per-view calls.
 
void SetupPostLogicViewCalls (const Util::Array< ViewDependentCall > &calls)
 Setup per-view calls.
 
void RunPreLogic ()
 Run pre-logic calls.
 
void RunPostLogic ()
 Run post-logic calls.
 
void Render ()
 Render views.
 
void EndFrame ()
 End the frame and submit.
 
void NewFrame ()
 Progress to next frame.
 
const Timing::Time GetTime () const
 get total time in seconds
 
const Timing::Time GetFrameTime () const
 get frame time in seconds
 
const IndexT GetFrameIndex () const
 get frame index
 
void RenderDebug (uint32_t flags)
 debug rendering
 
void RegisterGraphicsContext (GraphicsContextFunctionBundle *context, GraphicsContextState *state)
 register function bundle from graphics context, see GraphicsContextType::Create
 
void UnregisterGraphicsContext (GraphicsContextFunctionBundle *context)
 unregister function bundle
 
void OnWindowResized (CoreGraphics::WindowId wndId)
 call when the window has been resized
 
- 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
 

Private Member Functions

 __DeclareClass (GraphicsServer)
 
 __DeclareSingleton (GraphicsServer)
 

Private Attributes

Ids::IdGenerationPool entityPool
 
Ptr< FrameSync::FrameSyncTimertimer
 
bool ownsTimer
 
FrameContext frameContext
 
Util::Array< GraphicsContextFunctionBundle * > contexts
 
Util::Array< GraphicsContextState * > states
 
Util::Array< Ptr< Stage > > stages
 
Util::Array< Ptr< View > > views
 
CoreGraphics::BatchGroup batchGroupRegistry
 
Ptr< ViewcurrentView
 
Ptr< CoreGraphics::DisplayDevicedisplayDevice
 
bool graphicsDevice
 
Ptr< CoreGraphics::ShaderServershaderServer
 
Ptr< CoreGraphics::ShapeRenderershapeRenderer
 
Ptr< CoreGraphics::TextRenderertextRenderer
 
Ptr< Frame::FrameServerframeServer
 
Util::Array< ViewIndependentCallpreLogicCalls
 
Util::Array< ViewIndependentCallpostLogicCalls
 
Util::Array< ViewDependentCallpreLogicViewCalls
 
Util::Array< ViewDependentCallpostLogicViewCalls
 
bool isOpen
 

Friends

class CoreGraphics::BatchGroup
 

Additional Inherited Members

- 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)
 

Constructor & Destructor Documentation

◆ GraphicsServer()

Graphics::GraphicsServer::GraphicsServer ( )

constructor

◆ ~GraphicsServer()

Graphics::GraphicsServer::~GraphicsServer ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

Graphics::GraphicsServer::__DeclareClass ( GraphicsServer )
private

◆ __DeclareSingleton()

Graphics::GraphicsServer::__DeclareSingleton ( GraphicsServer )
private

◆ Close()

void Graphics::GraphicsServer::Close ( )

closes the graphics server

◆ CreateGraphicsEntity()

GraphicsEntityId Graphics::GraphicsServer::CreateGraphicsEntity ( )

create graphics entity

◆ CreateStage()

Ptr< Graphics::Stage > Graphics::GraphicsServer::CreateStage ( const Util::StringAtom & name,
bool main )

create a new stage

◆ CreateView() [1/2]

Ptr< Graphics::View > Graphics::GraphicsServer::CreateView ( const Util::StringAtom & name)

create a new view without a framescript

◆ CreateView() [2/2]

Ptr< Graphics::View > Graphics::GraphicsServer::CreateView ( const Util::StringAtom & name,
const IO::URI & framescript,
const CoreGraphics::WindowId window = CoreGraphics::InvalidWindowId )

create a new view with a new framescript

◆ DiscardGraphicsEntity()

void Graphics::GraphicsServer::DiscardGraphicsEntity ( const GraphicsEntityId id)

discard graphics entity

◆ DiscardStage()

void Graphics::GraphicsServer::DiscardStage ( const Ptr< Stage > & stage)

discard stage

◆ DiscardView()

void Graphics::GraphicsServer::DiscardView ( const Ptr< View > & view)

discard view

◆ EndFrame()

void Graphics::GraphicsServer::EndFrame ( )

End the frame and submit.

◆ GetCurrentView()

const Ptr< View > & Graphics::GraphicsServer::GetCurrentView ( ) const
inline

get current view

◆ GetFrameIndex()

const IndexT Graphics::GraphicsServer::GetFrameIndex ( ) const
inline

get frame index

◆ GetFrameTime()

const Timing::Time Graphics::GraphicsServer::GetFrameTime ( ) const
inline

get frame time in seconds

◆ GetTime()

const Timing::Time Graphics::GraphicsServer::GetTime ( ) const
inline

get total time in seconds

◆ IsValidGraphicsEntity()

bool Graphics::GraphicsServer::IsValidGraphicsEntity ( const GraphicsEntityId id)

check if graphics entity is valid

◆ NewFrame()

void Graphics::GraphicsServer::NewFrame ( )

Progress to next frame.

◆ OnWindowResized()

void Graphics::GraphicsServer::OnWindowResized ( CoreGraphics::WindowId wndId)

call when the window has been resized

◆ Open()

void Graphics::GraphicsServer::Open ( )

opens the graphics server

◆ RegisterGraphicsContext()

void Graphics::GraphicsServer::RegisterGraphicsContext ( GraphicsContextFunctionBundle * context,
GraphicsContextState * state )

register function bundle from graphics context, see GraphicsContextType::Create

◆ Render()

void Graphics::GraphicsServer::Render ( )

Render views.

◆ RenderDebug()

void Graphics::GraphicsServer::RenderDebug ( uint32_t flags)

debug rendering

◆ RunPostLogic()

void Graphics::GraphicsServer::RunPostLogic ( )

Run post-logic calls.

◆ RunPreLogic()

void Graphics::GraphicsServer::RunPreLogic ( )

Run pre-logic calls.

◆ SetCurrentView()

void Graphics::GraphicsServer::SetCurrentView ( const Ptr< View > & view)

set current view (do not use unless you know what you are doing since this is normally handled by the graphicssserver)

◆ SetupPostLogicCalls()

void Graphics::GraphicsServer::SetupPostLogicCalls ( const Util::Array< ViewIndependentCall > & calls)
inline

Setup post game logic graphics calls.

◆ SetupPostLogicViewCalls()

void Graphics::GraphicsServer::SetupPostLogicViewCalls ( const Util::Array< ViewDependentCall > & calls)
inline

Setup per-view calls.

◆ SetupPreLogicCalls()

void Graphics::GraphicsServer::SetupPreLogicCalls ( const Util::Array< ViewIndependentCall > & calls)
inline

Setup pre game logic graphics calls.

◆ SetupPreLogicViewCalls()

void Graphics::GraphicsServer::SetupPreLogicViewCalls ( const Util::Array< ViewDependentCall > & calls)
inline

Setup per-view calls.

◆ UnregisterGraphicsContext()

void Graphics::GraphicsServer::UnregisterGraphicsContext ( GraphicsContextFunctionBundle * context)

unregister function bundle

Friends And Related Symbol Documentation

◆ CoreGraphics::BatchGroup

friend class CoreGraphics::BatchGroup
friend

Member Data Documentation

◆ batchGroupRegistry

CoreGraphics::BatchGroup Graphics::GraphicsServer::batchGroupRegistry
private

◆ contexts

Util::Array<GraphicsContextFunctionBundle*> Graphics::GraphicsServer::contexts
private

◆ currentView

Ptr<View> Graphics::GraphicsServer::currentView
private

◆ displayDevice

Ptr<CoreGraphics::DisplayDevice> Graphics::GraphicsServer::displayDevice
private

◆ entityPool

Ids::IdGenerationPool Graphics::GraphicsServer::entityPool
private

◆ frameContext

FrameContext Graphics::GraphicsServer::frameContext
private

◆ frameServer

Ptr<Frame::FrameServer> Graphics::GraphicsServer::frameServer
private

◆ graphicsDevice

bool Graphics::GraphicsServer::graphicsDevice
private

◆ isOpen

bool Graphics::GraphicsServer::isOpen
private

◆ ownsTimer

bool Graphics::GraphicsServer::ownsTimer
private

◆ postLogicCalls

Util::Array<ViewIndependentCall> Graphics::GraphicsServer::postLogicCalls
private

◆ postLogicViewCalls

Util::Array<ViewDependentCall> Graphics::GraphicsServer::postLogicViewCalls
private

◆ preLogicCalls

Util::Array<ViewIndependentCall> Graphics::GraphicsServer::preLogicCalls
private

◆ preLogicViewCalls

Util::Array<ViewDependentCall> Graphics::GraphicsServer::preLogicViewCalls
private

◆ shaderServer

Ptr<CoreGraphics::ShaderServer> Graphics::GraphicsServer::shaderServer
private

◆ shapeRenderer

Ptr<CoreGraphics::ShapeRenderer> Graphics::GraphicsServer::shapeRenderer
private

◆ stages

Util::Array<Ptr<Stage> > Graphics::GraphicsServer::stages
private

◆ states

Util::Array<GraphicsContextState*> Graphics::GraphicsServer::states
private

◆ textRenderer

Ptr<CoreGraphics::TextRenderer> Graphics::GraphicsServer::textRenderer
private

◆ timer

Ptr<FrameSync::FrameSyncTimer> Graphics::GraphicsServer::timer
private

◆ views

Util::Array<Ptr<View> > Graphics::GraphicsServer::views
private

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