Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #ifndef __SP_HWBUFFER_VERTEXFORMATUNIVERSAL_H__
00009 #define __SP_HWBUFFER_VERTEXFORMATUNIVERSAL_H__
00010 
00011 
00012 #include "Base/spStandard.hpp"
00013 #include "Base/spVertexFormat.hpp"
00014 
00015 
00016 namespace sp
00017 {
00018 namespace video
00019 {
00020 
00021 
00025 class SP_EXPORT VertexFormatUniversal : public VertexFormat
00026 {
00027     
00028     public:
00029         
00030         VertexFormatUniversal();
00031         ~VertexFormatUniversal();
00032         
00033         u32 getFormatSize() const;
00034         
00041         void addCoord(const ERendererDataTypes Type = DATATYPE_FLOAT, s32 Size = 3);
00042         
00047         void addColor(const ERendererDataTypes Type = DATATYPE_UNSIGNED_BYTE, s32 Size = 4);
00048         
00050         void addNormal(const ERendererDataTypes Type = DATATYPE_FLOAT);
00051         
00056         void addBinormal(const ERendererDataTypes Type = DATATYPE_FLOAT);
00057         
00062         void addTangent(const ERendererDataTypes Type = DATATYPE_FLOAT);
00063         
00068         void addTexCoord(const ERendererDataTypes Type = DATATYPE_FLOAT, s32 Size = 2);
00069         
00074         void addFogCoord(const ERendererDataTypes Type = DATATYPE_FLOAT);
00075         
00087         void addUniversal(
00088             const ERendererDataTypes Type, s32 Size, const io::stringc &Name,
00089             bool Normalize = false, const EVertexFormatFlags Attribute = VERTEXFORMAT_UNIVERSAL
00090         );
00091         
00097         void remove(const EVertexFormatFlags Type);
00098         
00100         void clear();
00101         
00102     private:
00103         
00104         
00105         
00106         void updateConstruction();
00107         
00108         void addAttribute(
00109             const EVertexFormatFlags Flag, SVertexAttribute &Attrib, s32 Size,
00110             const ERendererDataTypes Type, const io::stringc &Name,
00111             bool hasDefaultSetting = false, bool Normalize = false
00112         );
00113         
00114         void addVirtualAttribute(const EVertexFormatFlags Attribute, SVertexAttribute &DestAttrib);
00115         
00116         
00117         
00118         u32 FormatSize_;
00119         
00120 };
00121 
00122 
00123 } 
00124 
00125 } 
00126 
00127 
00128 #endif
00129 
00130 
00131 
00132