00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef OSDL_RENDERER_H_
00028 #define OSDL_RENDERER_H_
00029
00030
00031 #include "OSDLEvents.h"
00032
00033 #include "OSDLException.h"
00034
00035 #include "Ceylan.h"
00036
00037 #include <string>
00038
00039
00040
00041
00042 namespace OSDL
00043 {
00044
00045
00046
00047 namespace Rendering
00048 {
00049
00050
00051
00057 class OSDL_DLL RenderingException : public OSDL::Exception
00058 {
00059 public:
00060
00061 explicit RenderingException( const std::string & reason ) ;
00062
00063 virtual ~RenderingException() throw() ;
00064
00065 } ;
00066
00067
00068
00069
00074 typedef Ceylan::Uint32 RenderCount ;
00075
00076
00077
00078
00117 class OSDL_DLL Renderer : public Ceylan::Object
00118 {
00119
00120
00121
00122 public:
00123
00124
00125
00138 explicit Renderer( bool registerToScheduler = true ) ;
00139
00140
00141
00146 virtual ~Renderer() throw() ;
00147
00148
00149
00165 virtual void render(
00166 Events::RenderingTick currentRenderingTick = 0 ) ;
00167
00168
00169
00183 virtual void onRenderingSkipped(
00184 Events::RenderingTick skippedRenderingTick ) ;
00185
00186
00187
00200 virtual const std::string toString(
00201 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00202
00203
00204
00205
00206
00207
00208
00209
00210
00217 static bool HasExistingRootRenderer() ;
00218
00219
00220
00237 static Renderer & GetExistingRootRenderer() ;
00238
00239
00240
00247 static void DeleteExistingRootRenderer() ;
00248
00249
00250
00255 static void DeleteRootRenderer() ;
00256
00257
00258
00259
00260
00261 protected:
00262
00263
00264
00269 RenderCount _renderingDone ;
00270
00271
00272
00277 RenderCount _renderingSkipped ;
00278
00279
00280
00287 Events::RenderingTick _lastRender ;
00288
00289
00290
00291
00292
00293
00294
00295
00296 private:
00297
00298
00307 explicit Renderer( const Renderer & source ) ;
00308
00309
00310
00319 Renderer & operator = ( const Renderer & source ) ;
00320
00321
00322
00328 static Renderer * _internalRootRenderer ;
00329
00330
00331 } ;
00332
00333
00334 }
00335
00336 }
00337
00338
00339
00340 #endif // OSDL_RENDERER_H_
00341