gfxGLVertexDecl.h 993 B

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