161 return GraphicsServer::Instance()->CreateGraphicsEntity();
170 GraphicsServer::Instance()->DiscardGraphicsEntity(
id);
176template<
typename ... CONTEXTS>
180 (CONTEXTS::RegisterEntity(
id), ...);
186template<
typename ... CONTEXTS>
190 (CONTEXTS::DeregisterEntity(
id), ...);
The common base class of Nebula.
Definition refcounted.h:38
BatchGroup denotes a zero indexed name registry which corresponds to the type of materials being batc...
Definition batchgroup.h:31
Definition graphicscontext.h:165
The graphics server is the main singleton for the Graphics subsystem.
Definition graphicsserver.h:49
void Render()
Render views.
Definition graphicsserver.cc:541
void SetupPreLogicViewCalls(const Util::Array< ViewDependentCall > &calls)
Setup per-view calls.
Definition graphicsserver.h:224
void RunPostLogic()
Run post-logic calls.
Definition graphicsserver.cc:504
void DiscardStage(const Ptr< Stage > &stage)
discard stage
Definition graphicsserver.cc:339
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...
Definition graphicsserver.cc:417
void DiscardGraphicsEntity(const GraphicsEntityId id)
discard graphics entity
Definition graphicsserver.cc:310
void Close()
closes the graphics server
Definition graphicsserver.cc:226
Ptr< View > CreateView(const Util::StringAtom &name, const IO::URI &framescript, const CoreGraphics::WindowId window=CoreGraphics::InvalidWindowId)
create a new view with a new framescript
Definition graphicsserver.cc:350
Util::Array< ViewIndependentCall > postLogicCalls
Definition graphicsserver.h:149
const Timing::Time GetFrameTime() const
get frame time in seconds
Definition graphicsserver.h:251
Util::Array< GraphicsContextState * > states
Definition graphicsserver.h:135
void NewFrame()
Progress to next frame.
Definition graphicsserver.cc:574
void SetupPreLogicCalls(const Util::Array< ViewIndependentCall > &calls)
Setup pre game logic graphics calls.
Definition graphicsserver.h:206
GraphicsEntityId CreateGraphicsEntity()
create graphics entity
Definition graphicsserver.cc:299
FrameContext frameContext
Definition graphicsserver.h:132
Util::Array< GraphicsContextFunctionBundle * > contexts
Definition graphicsserver.h:134
Util::Array< ViewDependentCall > preLogicViewCalls
Definition graphicsserver.h:150
const Ptr< View > & GetCurrentView() const
get current view
Definition graphicsserver.h:197
GraphicsServer()
constructor
Definition graphicsserver.cc:34
const Timing::Time GetTime() const
get total time in seconds
Definition graphicsserver.h:242
void OnWindowResized(CoreGraphics::WindowId wndId)
call when the window has been resized
Definition graphicsserver.cc:283
const IndexT GetFrameIndex() const
get frame index
Definition graphicsserver.h:260
Ptr< CoreGraphics::ShapeRenderer > shapeRenderer
Definition graphicsserver.h:145
void SetupPostLogicCalls(const Util::Array< ViewIndependentCall > &calls)
Setup post game logic graphics calls.
Definition graphicsserver.h:215
Ptr< CoreGraphics::ShaderServer > shaderServer
Definition graphicsserver.h:144
Util::Array< Ptr< Stage > > stages
Definition graphicsserver.h:137
bool isOpen
Definition graphicsserver.h:152
Ids::IdGenerationPool entityPool
Definition graphicsserver.h:128
Ptr< FrameSync::FrameSyncTimer > timer
Definition graphicsserver.h:130
Ptr< Frame::FrameServer > frameServer
Definition graphicsserver.h:147
void DiscardView(const Ptr< View > &view)
discard view
Definition graphicsserver.cc:398
void Open()
opens the graphics server
Definition graphicsserver.cc:52
__DeclareSingleton(GraphicsServer)
void RenderDebug(uint32_t flags)
debug rendering
Definition graphicsserver.cc:427
Ptr< CoreGraphics::TextRenderer > textRenderer
Definition graphicsserver.h:146
void RegisterGraphicsContext(GraphicsContextFunctionBundle *context, GraphicsContextState *state)
register function bundle from graphics context, see GraphicsContextType::Create
Definition graphicsserver.cc:261
bool graphicsDevice
Definition graphicsserver.h:143
void SetupPostLogicViewCalls(const Util::Array< ViewDependentCall > &calls)
Setup per-view calls.
Definition graphicsserver.h:233
Util::Array< ViewIndependentCall > preLogicCalls
Definition graphicsserver.h:149
void UnregisterGraphicsContext(GraphicsContextFunctionBundle *context)
unregister function bundle
Definition graphicsserver.cc:271
void RunPreLogic()
Run pre-logic calls.
Definition graphicsserver.cc:441
Util::Array< Ptr< View > > views
Definition graphicsserver.h:138
void EndFrame()
End the frame and submit.
Definition graphicsserver.cc:564
Util::Array< ViewDependentCall > postLogicViewCalls
Definition graphicsserver.h:150
Ptr< CoreGraphics::DisplayDevice > displayDevice
Definition graphicsserver.h:142
Ptr< Stage > CreateStage(const Util::StringAtom &name, bool main)
create a new stage
Definition graphicsserver.cc:328
bool IsValidGraphicsEntity(const GraphicsEntityId id)
check if graphics entity is valid
Definition graphicsserver.cc:319
virtual ~GraphicsServer()
destructor
Definition graphicsserver.cc:43
bool ownsTimer
Definition graphicsserver.h:131
CoreGraphics::BatchGroup batchGroupRegistry
Definition graphicsserver.h:139
Ptr< View > currentView
Definition graphicsserver.h:140
__DeclareClass(GraphicsServer)
A view describes a camera which can observe a Stage.
Definition view.h:23
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition uri.h:67
Provides a system for creating array friendly id numbers with reuse and generations.
Definition idgenerationpool.h:43
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's dynamic array class.
Definition array.h:60
A StringAtom.
Definition stringatom.h:22
Implements the shader server used by Vulkan.
Definition cameramanager.h:21
static GraphicsEntityId CreateEntity()
Definition graphicsserver.h:159
void(*)(const Graphics::FrameContext &ctx) ViewIndependentCall
Definition graphicsserver.h:41
void(*)(const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx) ViewDependentCall
Definition graphicsserver.h:42
static void RegisterEntity(const GraphicsEntityId id)
Definition graphicsserver.h:178
static void DeregisterEntity(const GraphicsEntityId id)
Definition graphicsserver.h:188
static void DestroyEntity(const GraphicsEntityId id)
Definition graphicsserver.h:168
int Tick
the tick datatype (one tick == 1 millisecond)
Definition time.h:20
double Time
the time datatype
Definition time.h:18
Vulkan::GraphicsDeviceState state
Definition graphicsserver.h:33
Timing::Time frameTime
Definition graphicsserver.h:36
Timing::Time time
Definition graphicsserver.h:34
IndexT bufferIndex
Definition graphicsserver.h:38
Timing::Tick ticks
Definition graphicsserver.h:35
IndexT frameIndex
Definition graphicsserver.h:37
Definition graphicscontext.h:114
A graphics context is a resource which holds a contextual representation for a graphics entity.
Definition graphicscontext.h:136
The graphics entity is only an Id, to which we can attach GraphicsContexts.
Definition graphicsentity.h:16
int IndexT
Definition types.h:48