Nebula
|
#include <graphicsserver.h>
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.
Classes | |
struct | SwapInfo |
Public Types | |
using | PreViewCallback = void(*)(IndexT, IndexT) |
using | PostViewCallback = void(*)(IndexT, IndexT) |
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< View > | CreateView (const Util::StringAtom &name, void(*)(const Math::rectangle< int > &, IndexT, IndexT), const Math::rectangle< int > &viewport) |
create a new view with a new framescript | |
Ptr< View > | CreateView (const Util::StringAtom &name) |
create a new view without a framescript | |
const Ptr< View > & | GetView (const Util::StringAtom &name) |
Get view by name. | |
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) | |
void | AddPreViewCall (PreViewCallback callback) |
Add callback for rendering before the views are processed. | |
void | AddPostViewCall (PostViewCallback callback) |
Add callback for rendering after the views are processed. | |
void | SetResizeCall (void(*)(const SizeT, const SizeT)) |
Set a function to be run when resize. | |
void | SetSwapInfo (const SwapInfo &info) |
Setup the swap info. | |
Ptr< Stage > | CreateStage (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::String & | GetClassName () const |
get the class name | |
Util::FourCC | GetClassFourCC () const |
get the class FourCC code | |
Private Member Functions | |
__DeclareClass (GraphicsServer) | |
__DeclareSingleton (GraphicsServer) | |
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) | |
using Graphics::GraphicsServer::PostViewCallback = void(*)(IndexT, IndexT) |
using Graphics::GraphicsServer::PreViewCallback = void(*)(IndexT, IndexT) |
Graphics::GraphicsServer::GraphicsServer | ( | ) |
constructor
|
virtual |
destructor
|
private |
|
private |
|
inline |
Add callback for rendering after the views are processed.
|
inline |
Add callback for rendering before the views are processed.
void Graphics::GraphicsServer::Close | ( | ) |
closes the graphics server
GraphicsEntityId Graphics::GraphicsServer::CreateGraphicsEntity | ( | ) |
create graphics entity
Ptr< Graphics::Stage > Graphics::GraphicsServer::CreateStage | ( | const Util::StringAtom & | name, |
bool | main ) |
create a new stage
Ptr< Graphics::View > Graphics::GraphicsServer::CreateView | ( | const Util::StringAtom & | name | ) |
create a new view without a framescript
Ptr< Graphics::View > Graphics::GraphicsServer::CreateView | ( | const Util::StringAtom & | name, |
void(* | render )(const Math::rectangle< int > &, IndexT, IndexT), | ||
const Math::rectangle< int > & | viewport ) |
create a new view with a new framescript
void Graphics::GraphicsServer::DiscardGraphicsEntity | ( | const GraphicsEntityId | id | ) |
discard graphics entity
void Graphics::GraphicsServer::EndFrame | ( | ) |
End the frame and submit.
|
inline |
get frame index
|
inline |
get frame time in seconds
|
inline |
get total time in seconds
|
inline |
Get view by name.
bool Graphics::GraphicsServer::IsValidGraphicsEntity | ( | const GraphicsEntityId | id | ) |
check if graphics entity is valid
void Graphics::GraphicsServer::NewFrame | ( | ) |
Progress to next frame.
void Graphics::GraphicsServer::OnWindowResized | ( | CoreGraphics::WindowId | wndId | ) |
call when the window has been resized
void Graphics::GraphicsServer::Open | ( | ) |
opens the graphics server
void Graphics::GraphicsServer::RegisterGraphicsContext | ( | GraphicsContextFunctionBundle * | context, |
GraphicsContextState * | state ) |
register function bundle from graphics context, see GraphicsContextType::Create
void Graphics::GraphicsServer::Render | ( | ) |
Render views.
void Graphics::GraphicsServer::RenderDebug | ( | uint32_t | flags | ) |
debug rendering
void Graphics::GraphicsServer::RunPostLogic | ( | ) |
Run post-logic calls.
void Graphics::GraphicsServer::RunPreLogic | ( | ) |
Run pre-logic calls.
set current view (do not use unless you know what you are doing since this is normally handled by the graphicssserver)
Set a function to be run when resize.
|
inline |
Setup the swap info.
|
inline |
Setup post game logic graphics calls.
|
inline |
Setup per-view calls.
|
inline |
Setup pre game logic graphics calls.
|
inline |
Setup per-view calls.
void Graphics::GraphicsServer::UnregisterGraphicsContext | ( | GraphicsContextFunctionBundle * | context | ) |
unregister function bundle
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |