summaryrefslogtreecommitdiff
path: root/src/lua3
diff options
context:
space:
mode:
authorscuri <scuri>2010-06-24 19:16:35 +0000
committerscuri <scuri>2010-06-24 19:16:35 +0000
commitda0f58cecf7a5280df7efa4e8d4443cb65b0fe1d (patch)
treed218429e378e665654db9a41e103e50f727e3e5e /src/lua3
parent57d27736fe65aa25f8c03c790c11475cc06d1296 (diff)
*** empty log message ***
Diffstat (limited to 'src/lua3')
-rw-r--r--src/lua3/cdluagl.c43
-rw-r--r--src/lua3/cdluagl.def2
2 files changed, 45 insertions, 0 deletions
diff --git a/src/lua3/cdluagl.c b/src/lua3/cdluagl.c
new file mode 100644
index 0000000..408eadb
--- /dev/null
+++ b/src/lua3/cdluagl.c
@@ -0,0 +1,43 @@
+/** \file
+ * \brief GL Canvas Lua 3 Binding
+ *
+ * See Copyright Notice in cd.h
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "cd.h"
+#include "cdgl.h"
+
+#include <lua.h>
+#include <lauxlib.h>
+
+#include "cdlua.h"
+#include "cdluagl.h"
+#include "cdlua3_private.h"
+
+static void *cdgl_checkdata(int param)
+{
+ lua_Object data = lua_getparam(param);
+ if (!lua_isstring(data))
+ lua_error("cdCreateCanvas CD_GL: data should be of type string!");
+
+ return lua_getstring(data);
+}
+
+static cdContextLUA cdluaglctx =
+{
+ 0,
+ "CD_GL",
+ cdContextGL,
+ cdgl_checkdata,
+ NULL,
+ 0
+};
+
+void cdluagl_open(void)
+{
+ cdlua_addcontext(&cdluaglctx);
+}
+
diff --git a/src/lua3/cdluagl.def b/src/lua3/cdluagl.def
new file mode 100644
index 0000000..85639b9
--- /dev/null
+++ b/src/lua3/cdluagl.def
@@ -0,0 +1,2 @@
+EXPORTS
+ cdluagl_open \ No newline at end of file