Nebula
Loading...
Searching...
No Matches
graphicsfeatureunit.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
12#include "game/featureunit.h"
14#include "graphics/view.h"
15#include "graphics/stage.h"
16#include "input/inputserver.h"
18#include "core/cvar.h"
19
21
22//------------------------------------------------------------------------------
23namespace GraphicsFeature
24{
25
103
104//------------------------------------------------------------------------------
107inline void
109{
110 Core::CVarWriteInt(this->r_debug, 2);
111}
112
113//------------------------------------------------------------------------------
116inline void
118{
119 this->title = title;
120}
121
122//------------------------------------------------------------------------------
127{
128 return this->defaultView;
129}
130
131//------------------------------------------------------------------------------
136{
137 return this->defaultStage;
138}
139
140//------------------------------------------------------------------------------
143inline ViewHandle
148
149//------------------------------------------------------------------------------
152inline void
157
158} // namespace GraphicsFeature
159//------------------------------------------------------------------------------
A FeatureUnit is an encapsulated feature which can be added to an application.
Definition featureunit.h:34
Sets up the core rendering system and provides properties and managers for default usage,...
Definition graphicsfeatureunit.h:27
void OnActivate() override
Called upon activation of feature unit.
Definition graphicsfeatureunit.cc:102
Ptr< Graphics::GraphicsServer > gfxServer
Definition graphicsfeatureunit.h:86
Graphics::GraphicsEntityId globalLight
Definition graphicsfeatureunit.h:78
void OnFrame() override
called in the middle of the feature trigger cycle
Definition graphicsfeatureunit.cc:425
IO::URI defaultFrameScript
Definition graphicsfeatureunit.h:81
Ptr< Input::InputServer > inputServer
Definition graphicsfeatureunit.h:87
void SetFrameScript(IO::URI const &uri)
set framescript. must be done before OnActivate!
Definition graphicsfeatureunit.h:153
struct GraphicsFeature::GraphicsFeatureUnit::TerrainInstance terrain
void OnEndFrame() override
called at the end of the feature trigger cycle
Definition graphicsfeatureunit.cc:435
Ptr< Graphics::Stage > defaultStage
Definition graphicsfeatureunit.h:84
void SetWindowTitle(const Util::StringAtom &title)
Set window title.
Definition graphicsfeatureunit.h:117
void OnDeactivate() override
Called upon deactivation of feature unit.
Definition graphicsfeatureunit.cc:366
Ptr< Game::Manager > graphicsManager
Definition graphicsfeatureunit.h:90
CoreGraphics::WindowId wnd
Definition graphicsfeatureunit.h:88
void OnAttach() override
called from GameServer::AttachGameFeature()
Definition graphicsfeatureunit.cc:87
Ptr< Graphics::View > defaultView
Definition graphicsfeatureunit.h:83
Ptr< Graphics::View > GetDefaultView() const
retrieve the default view
Definition graphicsfeatureunit.h:126
ViewHandle GetDefaultViewHandle() const
retrieve the default view handle
Definition graphicsfeatureunit.h:144
ViewHandle defaultViewHandle
Definition graphicsfeatureunit.h:98
void OnBeforeViews() override
Called before views.
Definition graphicsfeatureunit.cc:415
Core::CVar * r_show_frame_inspector
Definition graphicsfeatureunit.h:101
void SetGraphicsDebugging(bool value)
Set Graphics Debugging on/off.
Ptr< Game::Manager > cameraManager
Definition graphicsfeatureunit.h:91
Ptr< Graphics::Stage > GetDefaultStage() const
retrieve the default stage
Definition graphicsfeatureunit.h:135
void OnRenderDebug() override
called when game debug visualization is on
Definition graphicsfeatureunit.cc:457
__DeclareClass(GraphicsFeatureUnit) __DeclareSingleton(GraphicsFeatureUnit) public ~GraphicsFeatureUnit()
destructor
Definition graphicsfeatureunit.cc:78
Core::CVar * r_debug
Definition graphicsfeatureunit.h:100
Util::StringAtom title
Definition graphicsfeatureunit.h:82
void SetupTerrainBiome(const Terrain::BiomeSettings &biomeParameters)
Setup terrain biome, run before OnActivate.
void OnBeginFrame() override
called on begin of frame
Definition graphicsfeatureunit.cc:388
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition uri.h:67
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
Contains API for creating, writing to, and reading from a Core::CVar.
void CVarWriteInt(CVar *cVar, int value)
Write int value to cvar.
Definition cvar.cc:133
Definition graphicsfeatureunit.cc:61
uint ViewHandle
Definition cameramanager.h:28
#define __DeclareSingleton(type)
Definition osxsingleton.h:24
#define __DeclareClass(type)
A console variable.
Definition cvar.cc:24
Definition window.h:25
The graphics entity is only an Id, to which we can attach GraphicsContexts.
Definition graphicsentity.h:16
Graphics::GraphicsEntityId entity
Definition graphicsfeatureunit.h:95
Util::Array< Terrain::TerrainBiomeId > biomes
Definition graphicsfeatureunit.h:96
Definition terraincontext.h:85