summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/VertexBuffer.h
blob: b03df3bc700a6af90488bf5ed82e88d7b32cdb28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include <vector>

#include "../Utilities/UtilMacros.h"
#include "../Shaders/ShaderChannel.h"

#include "OpenGL.h"
#include "GPUDataBuffer.h"
#include "DefaultVertexLayout.h"
#include "CustomVertexLayout.h"
#include "Primitive.h"

// 实际使用过程中,通常是一个VBO和一个IBO一起,submesh对应的是IBO中的不同的段,而不是不同的IBO

class VertexBuffer
{
public:
	enum VertexBufferType
	{
		VertexBufferType_Static, // device
		VertexBufferType_Stream, // pinned (best performance)
		VertexBufferType_Dynamic,// device
	};

	VertexBuffer(VertexBufferType type);
	~VertexBuffer();

	void Draw();

private:
	VertexBufferType m_Type;

	GPU::DataBuffer* m_VB;
	GPU::DataBuffer* m_IB;

    EPrimitive m_Primitive;

};