summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/mesh2d.h
blob: d2d7d3bb0c71c89521076669863933a0a4af74ac (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
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __ASURA_ENGINE_MESH2D_H__
#define __ASURA_ENGINE_MESH2D_H__

// cpp
#include <vector>

// asura modules
#include <asura-utils/scripting/portable.hpp>
#include <asura-utils/math/vector2.hpp>

// module 
#include "../mesh/mesh2d_data.h"

// folder
#include "color.h"
#include "vertex_buffer.h"
#include "index_buffer.h"

namespace_begin(AsuraEngine)
namespace_begin(Graphics)
		
///
/// 2D meshһЩ㶯
/// https://en.wikipedia.org/wiki/Polygon_mesh
///
class Mesh2D ASURA_FINAL 
	: public Scripting::Portable<Mesh2D>
{
public:

	Mesh2D();
	~Mesh2D();

	bool Load(AEMesh::Mesh2DData* data);

private: 

	VertexBuffer* m_VBO; ///< vertex buffer 
	IndexBuffer*  m_IBO; ///< index buffer 

luaxport: 

	LUAX_DECL_FACTORY(Mesh2D);

	LUAX_DECL_METHOD(_SetVertex);

};

namespace_end
namespace_end

#endif