gfxGLVertexDecl.h
Engine/source/gfx/gl/gfxGLVertexDecl.h
Classes:
Detailed Description
1 2#ifndef GFX_GL_VERTEX_DECL 3#define GFX_GL_VERTEX_DECL 4 5class GFXVertexFormat; 6class GFXGLDevice; 7 8class GFXGLVertexDecl : public GFXVertexDecl 9{ 10public: 11 GFXGLVertexDecl() : mFormat(NULL), mVertexAttribActiveMask(0) { std::fill_n(mVertexSize, 4, 0); } 12 void init(const GFXVertexFormat *format); 13 14 void prepareVertexFormat() const; 15 void prepareBuffer_old(U32 stream, GLint mBuffer, GLint mDivisor) const; 16 void updateActiveVertexAttrib(U32 lastActiveMask) const; 17 18 struct glVertexAttribData 19 { 20 U32 stream; 21 GLint attrIndex; 22 GLint elementCount; // 1 - 4 23 GLenum type; // GL_FLOAT... 24 GLboolean normalized; 25 GLsizei stride; 26 GLvoid *pointerFirst; 27 }; 28 29protected: 30 friend class GFXGLDevice; 31 const GFXVertexFormat *mFormat; 32 GLuint mVertexSize[4]; 33 U32 mVertexAttribActiveMask; 34 Vector<glVertexAttribData> glVerticesFormat; 35 36 void _initVerticesFormat(U32 stream); 37 void _initVerticesFormat2(); 38}; 39 40#endif //GFX_GL_VERTEX_DECL 41