summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/binding/_gl.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-04-03 09:00:13 +0800
committerchai <chaifix@163.com>2019-04-03 09:00:13 +0800
commitc8a6a8e2dd6f015a31b4f8191ad945a78fe77f3d (patch)
tree8060458d7aa5e514cdef32f6f92e157221efde4a /source/modules/asura-core/graphics/binding/_gl.cpp
parentaf7bdaa10ee71a319dc55c3c7556fa43a95c9dc9 (diff)
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/binding/_gl.cpp')
-rw-r--r--source/modules/asura-core/graphics/binding/_gl.cpp127
1 files changed, 127 insertions, 0 deletions
diff --git a/source/modules/asura-core/graphics/binding/_gl.cpp b/source/modules/asura-core/graphics/binding/_gl.cpp
new file mode 100644
index 0000000..4c0605f
--- /dev/null
+++ b/source/modules/asura-core/graphics/binding/_gl.cpp
@@ -0,0 +1,127 @@
+#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_PROJECTION },
+ { "MODELVIEW", MATRIX_MODELVIEW }
+ );
+
+ }
+
+ // 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;
+ }
+
+ }
+}