00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef GLUONGRAPHICS_ENGINE_H
00024 #define GLUONGRAPHICS_ENGINE_H
00025
00026 #include "gluon_graphics_export.h"
00027 #include <core/singleton.h>
00028
00029 namespace GluonGraphics
00030 {
00031 class Camera;
00032 class Mesh;
00033 class Material;
00034 class Item;
00035 class Texture;
00036 class Viewport;
00037
00054 class GLUON_GRAPHICS_EXPORT Engine : public GluonCore::Singleton<Engine>
00055 {
00056 Q_OBJECT
00057 public:
00066 void initialize();
00067
00079 Item* createItem( const QString& mesh );
00080
00089 void destroyItem( Item* item );
00090
00099 Material* createMaterial( const QString& name );
00100
00110 void destroyMaterial( const QString& name );
00111
00119 bool hasMaterial( const QString& name );
00120
00128 Material* material( const QString& name );
00129
00141 bool addMaterial( const QString& name, Material* material );
00142
00150 void removeMaterial( const QString& name );
00151
00160 Mesh* createMesh( const QString& name );
00161
00171 void destroyMesh( const QString& name );
00172
00180 bool hasMesh( const QString& name );
00181
00189 Mesh* mesh( const QString& name );
00190
00201 bool addMesh( const QString& name, Mesh* mesh );
00202
00210 void removeMesh( const QString& name );
00211
00222 Texture* createTexture( const QString& name );
00223
00233 void destroyTexture( const QString& name );
00234
00242 bool hasTexture( const QString& name );
00243
00251 Texture* texture( const QString& name );
00252
00264 bool addTexture( const QString& name, Texture* texture );
00265
00273 void removeTexture( const QString& name );
00274
00281 Camera* activeCamera();
00282
00283 Viewport* currentViewport();
00284
00285 public Q_SLOTS:
00291 void render();
00292
00308 void setFramebufferSize( int width, int height );
00309
00317 void setActiveCamera( Camera* camera );
00318
00319 void setViewport( Viewport* viewport );
00320
00321 Q_SIGNALS:
00325 void activeCameraChanged( Camera* );
00326
00327 private:
00328 friend class GluonCore::Singleton<Engine>;
00329
00330 Engine();
00331 ~Engine();
00332 Q_DISABLE_COPY( Engine );
00333
00334 class EnginePrivate;
00335 EnginePrivate* const d;
00336 };
00337 }
00338
00339 #endif // GLUONGRAPHICS_ENGINE_H