Commit c664d6b052d8d3075e86c2497aaf45aec6693524

Thomas de Grivel 2024-05-18T15:12:36

lib/c3/0.1/gl/*.c3

diff --git a/lib/c3/0.1/gl/dvec2.c3 b/lib/c3/0.1/gl/dvec2.c3
new file mode 100644
index 0000000..114f995
--- /dev/null
+++ b/lib/c3/0.1/gl/dvec2.c3
@@ -0,0 +1,6 @@
+defmodule GL.Dvec2 do
+
+  defstruct [x: (F64) 0,
+             y: (F64) 0]
+
+end
diff --git a/lib/c3/0.1/gl/dvec3.c3 b/lib/c3/0.1/gl/dvec3.c3
new file mode 100644
index 0000000..6d2bbeb
--- /dev/null
+++ b/lib/c3/0.1/gl/dvec3.c3
@@ -0,0 +1,7 @@
+defmodule GL.Dvec3 do
+
+  defstruct [x: (F64) 0,
+             y: (F64) 0,
+             z: (F64) 0]
+
+end
diff --git a/lib/c3/0.1/gl/object.c3 b/lib/c3/0.1/gl/object.c3
new file mode 100644
index 0000000..6c9efa4
--- /dev/null
+++ b/lib/c3/0.1/gl/object.c3
@@ -0,0 +1,12 @@
+defmodule GL.Object do
+
+  defstruct [vertex: (GL.Vertex[]) {},
+             triangle: (GL.Triangle[]) {},
+             gl_mode: (U32) 0,
+             gl_vao: (U32) 0,
+             gl_vbo: (U32) 0,
+             gl_ebo: (U32) 0]
+
+  def clean = cfn Void "gl_object_clean" (GL.Object)
+
+end
diff --git a/lib/c3/0.1/gl/sphere.c3 b/lib/c3/0.1/gl/sphere.c3
new file mode 100644
index 0000000..4ba9ce4
--- /dev/null
+++ b/lib/c3/0.1/gl/sphere.c3
@@ -0,0 +1,9 @@
+defmodule GL.Sphere do
+
+  defstruct [object: %GL.Object{},
+             segments_u: (Uw) 3,
+             segments_v: (Uw) 2]
+
+  def clean = cfn Void "gl_sphere_clean" (GL.Sphere)
+
+end
diff --git a/lib/c3/0.1/gl/triangle.c3 b/lib/c3/0.1/gl/triangle.c3
new file mode 100644
index 0000000..1e496b0
--- /dev/null
+++ b/lib/c3/0.1/gl/triangle.c3
@@ -0,0 +1,7 @@
+defmodule GL.Triangle do
+
+  defstruct [a: (U32) 0,
+             b: (U32) 1,
+             c: (U32) 2]
+
+end
diff --git a/lib/c3/0.1/gl/vec2.c3 b/lib/c3/0.1/gl/vec2.c3
new file mode 100644
index 0000000..621a0b1
--- /dev/null
+++ b/lib/c3/0.1/gl/vec2.c3
@@ -0,0 +1,6 @@
+defmodule GL.Vec2 do
+
+  defstruct, [x: (F32) 0,
+              y: (F32) 0]
+
+end
diff --git a/lib/c3/0.1/gl/vec3.c3 b/lib/c3/0.1/gl/vec3.c3
new file mode 100644
index 0000000..bb3d548
--- /dev/null
+++ b/lib/c3/0.1/gl/vec3.c3
@@ -0,0 +1,7 @@
+defmodule GL.Vec3 do
+
+  defstruct [x: (F32) 0,
+             y: (F32) 0,
+             z: (F32) 0]
+
+end
diff --git a/lib/c3/0.1/gl/vertex.c3 b/lib/c3/0.1/gl/vertex.c3
new file mode 100644
index 0000000..cc90688
--- /dev/null
+++ b/lib/c3/0.1/gl/vertex.c3
@@ -0,0 +1,7 @@
+defmodule GL.Vertex do
+
+  defstruct [position:  %GL.Vec3{},
+             normal:    %GL.Vec3{},
+             tex_coord: %GL.Vec2{}]
+
+end