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
00028 #ifndef _CEGUIIrrlichtGeometryBuffer_h_
00029 #define _CEGUIIrrlichtGeometryBuffer_h_
00030
00031 #include "CEGUIIrrlichtRendererDef.h"
00032 #include "../../CEGUIGeometryBuffer.h"
00033 #include "../../CEGUIRect.h"
00034 #include "../../CEGUIVector.h"
00035 #include <irrlicht.h>
00036 #include <vector>
00037
00038 #if defined(_MSC_VER)
00039 # pragma warning(push)
00040 # pragma warning(disable : 4251)
00041 #endif
00042
00043
00044 namespace CEGUI
00045 {
00046 class IrrlichtTexture;
00047
00049 class IRR_GUIRENDERER_API IrrlichtGeometryBuffer : public GeometryBuffer
00050 {
00051 public:
00053 IrrlichtGeometryBuffer(irr::video::IVideoDriver& driver);
00054
00056 const irr::core::matrix4& getMatrix() const;
00057
00059 irr::video::SMaterial& getMaterial();
00061 const irr::video::SMaterial& getMaterial() const;
00062
00063
00064
00065 void draw() const;
00066 void setTranslation(const Vector3& v);
00067 void setRotation(const Vector3& r);
00068 void setPivot(const Vector3& p);
00069 void setClippingRegion(const Rect& region);
00070 void appendVertex(const Vertex& vertex);
00071 void appendGeometry(const Vertex* const vbuff, uint vertex_count);
00072 void setActiveTexture(Texture* texture);
00073 void reset();
00074 Texture* getActiveTexture() const;
00075 uint getVertexCount() const;
00076 uint getBatchCount() const;
00077 void setRenderEffect(RenderEffect* effect);
00078 RenderEffect* getRenderEffect();
00079
00080 protected:
00082 void updateMatrix() const;
00083
00085 irr::video::IVideoDriver& d_driver;
00087 IrrlichtTexture* d_activeTexture;
00089 mutable irr::video::SMaterial d_material;
00091 Rect d_clipRect;
00093 irr::core::vector3d<irr::f32> d_translation;
00095 irr::core::vector3d<irr::f32> d_rotation;
00097 irr::core::vector3d<irr::f32> d_pivot;
00099 RenderEffect* d_effect;
00101 mutable irr::core::matrix4 d_matrix;
00103 mutable bool d_matrixValid;
00105 typedef std::pair<irr::video::ITexture*, uint> BatchInfo;
00107 typedef std::vector<BatchInfo> BatchList;
00109 typedef std::vector<irr::video::S3DVertex> VertexList;
00111 typedef std::vector<irr::u16> IndexList;
00113 BatchList d_batches;
00115 VertexList d_vertices;
00117 IndexList d_indices;
00119 const float d_xViewDir;
00121 const float d_texelOffset;
00122 };
00123
00124
00125 }
00126
00127 #if defined(_MSC_VER)
00128 # pragma warning(pop)
00129 #endif
00130
00131 #endif // end of guard _CEGUIIrrlichtGeometryBuffer_h_