Nebula
Loading...
Searching...
No Matches
renderapplication.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
11#include "app/application.h"
12#include "core/coreserver.h"
13#include "jobs/jobsystem.h"
15#include "io/ioserver.h"
16#include "io/iointerface.h"
17#include "graphics/graphicsinterface.h"
18#include "graphics/display.h"
19#include "timing/timer.h"
21#include "debug/debugtimer.h"
22#include "input/inputserver.h"
24#include "util/delegate.h"
25#include "messaging/message.h"
26#if __NEBULA_HTTP__
27#include "http/httpinterface.h"
29#endif
30#if __NEBULA_HTTP_FILESYSTEM__
32#endif
33
34//------------------------------------------------------------------------------
35namespace App
36{
38{
39public:
43 virtual ~RenderApplication();
44
46 void SetLogFileEnabled(bool b);
48 void SetOverrideRootDirectory(const Util::String& rootDir);
52 void SetMultithreadedRendering(bool b);
53
55 void SetWindowData(const Util::Blob& data);
56
58 virtual bool Open();
60 virtual void Close();
62 virtual void Run();
63
64private:
66 void UpdateTime();
67
68protected:
72 void SetQuitRequested(bool b);
74 bool IsQuitRequested() const;
76 virtual void OnConfigureDisplay();
78 virtual void OnSetupResourceMappers();
80 virtual void OnProcessInput();
82 virtual void OnUpdateFrame();
84 Timing::Time GetTime() const;
87
99
100#if __NEBULA_HTTP__
101 Ptr<Debug::DebugInterface> debugInterface;
102 Ptr<Http::HttpInterface> httpInterface;
103 Ptr<Http::HttpServerProxy> httpServerProxy;
104#endif
105
106#if __NEBULA_HTTP_FILESYSTEM__
107 Ptr<Http::HttpClientRegistry> httpClientRegistry;
108#endif
109
117
118 _declare_timer(MainThreadFrameTimeAll);
119 _declare_timer(MainThreadWaitForGraphicsFrame);
120};
121
122//------------------------------------------------------------------------------
125inline void
130
131//------------------------------------------------------------------------------
134inline void
139
140//------------------------------------------------------------------------------
143inline void
148
149//------------------------------------------------------------------------------
152inline void
154{
155 this->windowData = data;
156}
157
158//------------------------------------------------------------------------------
161inline void
163{
164 this->quitRequested = b;
165}
166
167//------------------------------------------------------------------------------
170inline bool
172{
173 return this->quitRequested;
174}
175
176//------------------------------------------------------------------------------
179inline Timing::Time
181{
182 return this->time;
183}
184
185//------------------------------------------------------------------------------
188inline Timing::Time
190{
191 return this->frameTime;
192}
193
194//------------------------------------------------------------------------------
197inline void
202
203
204} // namespace App
205//------------------------------------------------------------------------------
206
Provides a simple application model for Nebula apps.
Definition application.h:19
Render application class with multithreaded rendering.
Definition renderapplication.h:38
Timing::Time GetTime() const
get current absolute time
Definition renderapplication.h:180
void SetMultithreadedRendering(bool b)
set multithreaded rendering
Definition renderapplication.h:144
Util::String LookupProjectDirectory()
lookup the toolkit project key in the registry (Win32 only!)
Definition renderapplication.cc:72
void SetQuitRequested(bool b)
set quit requested flag
Definition renderapplication.h:162
Timing::Time frameTime
Definition renderapplication.h:111
RenderApplication()
constructor
Definition renderapplication.cc:49
bool logFileEnabled
Definition renderapplication.h:114
void SetLogFileEnabled(bool b)
enable/disable log file creation
Definition renderapplication.h:126
Util::Blob windowData
Definition renderapplication.h:98
virtual void OnProcessInput()
process input (called before rendering)
Definition renderapplication.cc:393
Util::String overrideRootDirectory
Definition renderapplication.h:116
Ptr< IO::IoInterface > ioInterface
Definition renderapplication.h:92
_declare_timer(MainThreadWaitForGraphicsFrame)
virtual void OnUpdateFrame()
update world
Definition renderapplication.cc:402
bool useMultithreadedRendering
Definition renderapplication.h:112
virtual void Run()
run the application
Definition renderapplication.cc:348
bool IsQuitRequested() const
return true if quit requested
Definition renderapplication.h:171
void SetMountStandardArchivesEnabled(bool b)
enable/disable standard archive mounting
Definition renderapplication.h:135
Timing::Time GetFrameTime() const
get current frame time
Definition renderapplication.h:189
Ptr< FrameSync::FrameSyncTimer > frameSyncTimer
Definition renderapplication.h:96
virtual void OnSetupResourceMappers()
called to setup resource mappers
Definition renderapplication.cc:259
void SetOverrideRootDirectory(const Util::String &rootDir)
override root-directory
Definition renderapplication.h:198
Ptr< Input::InputServer > inputServer
Definition renderapplication.h:95
bool mountStandardArchivesEnabled
Definition renderapplication.h:115
Ptr< Graphics::Display > display
Definition renderapplication.h:94
virtual bool Open()
open the application
Definition renderapplication.cc:86
void UpdateTime()
update the current time values
Definition renderapplication.cc:411
Ptr< Graphics::GraphicsInterface > graphicsInterface
Definition renderapplication.h:93
Ptr< Jobs::JobSystem > jobSystem
Definition renderapplication.h:89
void SetWindowData(const Util::Blob &data)
sets the parent window
Definition renderapplication.h:153
virtual void OnConfigureDisplay()
called to configure display
Definition renderapplication.cc:201
bool quitRequested
Definition renderapplication.h:113
Ptr< Resources::ResourceManager > resManager
Definition renderapplication.h:97
virtual void Close()
close the application
Definition renderapplication.cc:294
Timing::Time time
Definition renderapplication.h:110
virtual ~RenderApplication()
destructor
Definition renderapplication.cc:63
Ptr< IO::IoServer > ioServer
Definition renderapplication.h:91
_declare_timer(MainThreadFrameTimeAll)
Ptr< IO::GameContentServer > gameContentServer
Definition renderapplication.h:90
Ptr< Core::CoreServer > coreServer
Definition renderapplication.h:88
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
The Util::Blob class encapsulates a chunk of raw memory into a C++ object which can be copied,...
Definition blob.h:22
Definition gameapplication.cc:24
double Time
the time datatype
Definition time.h:18
Nebula's universal string class.
Definition string.h:50