summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/VertexBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Graphics/VertexBuffer.h')
-rw-r--r--Runtime/Graphics/VertexBuffer.h36
1 files changed, 3 insertions, 33 deletions
diff --git a/Runtime/Graphics/VertexBuffer.h b/Runtime/Graphics/VertexBuffer.h
index b38b0b6..05aa16c 100644
--- a/Runtime/Graphics/VertexBuffer.h
+++ b/Runtime/Graphics/VertexBuffer.h
@@ -8,21 +8,8 @@
#include "OpenGL.h"
#include "GPUDataBuffer.h"
-
-// 默认的顶点属性,够用了
-enum EVertexAttr
-{
- VertexAttr_Position = 0,
- VertexAttr_Normal,
- VertexAttr_Tangent,
- VertexAttr_Color,
- VertexAttr_UV,
- VertexAttr_UV2,
- VertexAttr_UV3,
- VertexAttr_UV4,
-
- VertexAttr_Count
-};
+#include "DefaultVertexLayout.h"
+#include "CustomVertexLayout.h"
enum EPrimitive
{
@@ -31,22 +18,6 @@ enum EPrimitive
Primitive_Point = 3,
};
-struct VertexAttributeDescriptor
-{
- const void* pointer; // 内存或显存
- uint componentType;
- uint componentNum;
- uint16 stride;
-};
-
-// GPU侧的顶点属性
-struct VertexDataInfo
-{
- uint32 enableMask;
- GLuint buffer;
- VertexAttributeDescriptor attributes[VertexAttr_Count];
-};
-
class VertexBuffer
{
public:
@@ -63,7 +34,6 @@ public:
void Draw();
private:
-
VertexBufferType m_Type;
GPU::DataBuffer *m_VB;
GPU::DataBuffer *m_IB;// vertex buffer and index buffer
@@ -83,7 +53,7 @@ public:
private:
- void FillVertexArrayInfo(VertexDataInfo& dst);
+ void FillVertexDataInfo(DefaultVertexLayout& dst);
void Clean();