src/backend/RenderSystem.h

Go to the documentation of this file.
00001 
00014 #ifndef RENDERSYSTEM_H
00015 #define RENDERSYSTEM_H
00016 
00017 #include <boost/shared_ptr.hpp>
00018                 
00019 namespace green
00020 {
00026         class RenderSystem
00027         {
00028                 protected:
00031                         class Color
00032                         {
00033                                 public:
00034                                         inline
00035                                         void Set(double _r, double _g, double _b, double _a) {
00036                                                 r = _r; g = _g; b = _b; a = _a;
00037                                         }
00038                                         double r, g, b, a;      
00039                         };
00040                         Color mClearColor;
00041                         Color mCurrentColor;
00042                         
00043                 public:
00044 
00048                         virtual ~RenderSystem() {}
00049                         
00052                         virtual void Init() {}
00053                         
00060                         virtual void StartFrame() {}
00061                         
00068                         virtual void FinishFrame() {}
00069                         
00074                         enum Graphic { SHIP, ASTEROID, BULLET };
00075                         
00082                         virtual void DrawObject(Graphic object, double x, double y, double rot) {}
00083                         
00091                         inline
00092                         virtual void SetColor(double r, double g, double b, double a) {
00093                                 mCurrentColor.Set(r, g, b, a);
00094                         }
00095                         
00103                         inline
00104                         virtual void SetClearColor(double r, double g, double b, double a) {
00105                                 mClearColor.Set(r, g, b, a);
00106                         }
00107                         
00113                         inline
00114                         virtual void Reshape(int width, int height) {}
00115                         
00116         };
00117         typedef boost::shared_ptr<RenderSystem> RenderSystemPtr;
00118 }
00119                 
00120 #endif

Generated on Fri Apr 27 10:27:37 2007 for Green Engine by  doxygen 1.5.1