summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/binding/_gl.cpp
blob: 0c3a18f4a724f0365eafb749f98bf62fb8225fb9 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#include "../gl.h"

using namespace std;
using namespace Luax;

namespace AsuraEngine 
{
	namespace Graphics 
	{
		
		LUAX_REGISTRY(OpenGL)
		{
			LUAX_REGISTER_METHODS(state,
				{ "SetMatrixMode",  _SetMatrixMode  },
				{ "GetMatrixMode",  _GetMatrixMode  },
				{ "PushMatrix",     _PushMatrix     },
				{ "PopMatrix",      _PopMatrix      },
				{ "LoadIdentity",   _LoadIdentity   },
				{ "Rotate",         _Rotate         },
				{ "Translate",      _Translate      },
				{ "Scale",          _Scale          },
				{ "Ortho",          _Ortho          },
				{ "GetMatrixDepth", _GetMatrixDepth },
				{ "GetMatrixIndex", _GetMatrixIndex }
			);
		}

		LUAX_POSTPROCESS(OpenGL)
		{
			LUAX_REGISTER_ENUM(state, "EMatrixMode",
				{ "PROJECTION",   MATRIX_MODE_PROJECTION },
				{ "MODEL",        MATRIX_MODE_MODEL      },
			  { "VIEW",         MATRIX_MODE_VIEW       }
			);

		}

		// GL.SetMatrixMode()
		LUAX_IMPL_METHOD(OpenGL, _SetMatrixMode)
		{
			LUAX_PREPARE(L, OpenGL);
			MatrixMode mode = (MatrixMode)state.CheckValue<int>(1);
			gl.SetMatrixMode(mode);
			return 0;
		}

		// GL.GetMatrixMode()
		LUAX_IMPL_METHOD(OpenGL, _GetMatrixMode)
		{
			LUAX_PREPARE(L, OpenGL);

			return 0;
		}

		// GL.PushMatrix()
		LUAX_IMPL_METHOD(OpenGL, _PushMatrix)
		{
			LUAX_PREPARE(L, OpenGL);

			return 0;
		}

		// GL.PopMatrix()
		LUAX_IMPL_METHOD(OpenGL, _PopMatrix)
		{
			LUAX_PREPARE(L, OpenGL);

			return 0;
		}

		// GL.LoadIdentity()
		LUAX_IMPL_METHOD(OpenGL, _LoadIdentity)
		{
			LUAX_PREPARE(L, OpenGL);

			return 0;
		}

		// GL.Rotate()
		LUAX_IMPL_METHOD(OpenGL, _Rotate)
		{
			LUAX_PREPARE(L, OpenGL);

			return 0;
		}

		// GL.Translate()
		LUAX_IMPL_METHOD(OpenGL, _Translate)
		{
			LUAX_PREPARE(L, OpenGL);

			return 0;
		}

		// GL.Scale()
		LUAX_IMPL_METHOD(OpenGL, _Scale)
		{
			LUAX_PREPARE(L, OpenGL);

			return 0;
		}

		// GL.Ortho()
		LUAX_IMPL_METHOD(OpenGL, _Ortho)
		{
			LUAX_PREPARE(L, OpenGL);

			return 0;
		}

		// GL.GetMatrixDepth()
		LUAX_IMPL_METHOD(OpenGL, _GetMatrixDepth)
		{
			LUAX_PREPARE(L, OpenGL);

			return 0;
		}

		// GL.GetMatrixIndex()
		LUAX_IMPL_METHOD(OpenGL, _GetMatrixIndex)
		{
			LUAX_PREPARE(L, OpenGL);

			return 0;
		}

	}
}