diff options
author | sanine <sanine.not@pm.me> | 2023-03-12 21:27:37 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-03-12 21:27:37 -0500 |
commit | bb8c38bffba86cda05e0e8e9b52fb68301286b53 (patch) | |
tree | ea2bc46a22ffe6807ffbeae32f4124de357ff4f7 |
initial commit
-rw-r--r-- | assets/cube.mtl | 10 | ||||
-rw-r--r-- | assets/cube.obj | 40 | ||||
-rw-r--r-- | assets/cube.png | bin | 0 -> 22611 bytes | |||
-rw-r--r-- | assets/dodecahedron.mtl | 10 | ||||
-rw-r--r-- | assets/dodecahedron.obj | 216 | ||||
-rw-r--r-- | assets/dodecahedron.png | bin | 0 -> 129552 bytes | |||
-rw-r--r-- | assets/icosahedron.mtl | 2 | ||||
-rw-r--r-- | assets/icosahedron.obj | 79 | ||||
-rw-r--r-- | assets/icosahedron.png | bin | 0 -> 75897 bytes | |||
-rw-r--r-- | assets/octohedron.mtl | 10 | ||||
-rw-r--r-- | assets/octohedron.obj | 32 | ||||
-rw-r--r-- | assets/octohedron.png | bin | 0 -> 32343 bytes | |||
-rw-r--r-- | assets/tetrahedron.mtl | 10 | ||||
-rw-r--r-- | assets/tetrahedron.obj | 24 | ||||
-rw-r--r-- | assets/tetrahedron.png | bin | 0 -> 60324 bytes | |||
-rw-r--r-- | honey/std.lua | 3 | ||||
-rw-r--r-- | honey/window.lua | 157 | ||||
-rw-r--r-- | main.lua | 10 |
18 files changed, 603 insertions, 0 deletions
diff --git a/assets/cube.mtl b/assets/cube.mtl new file mode 100644 index 0000000..f231bdf --- /dev/null +++ b/assets/cube.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/assets/cube.obj b/assets/cube.obj new file mode 100644 index 0000000..59558f1 --- /dev/null +++ b/assets/cube.obj @@ -0,0 +1,40 @@ +# Blender v3.4.1 OBJ File: '' +# www.blender.org +mtllib cube.mtl +o Cube_Cube.001 +v -1.000000 -1.000000 1.000000 +v -1.000000 1.000000 1.000000 +v -1.000000 -1.000000 -1.000000 +v -1.000000 1.000000 -1.000000 +v 1.000000 -1.000000 1.000000 +v 1.000000 1.000000 1.000000 +v 1.000000 -1.000000 -1.000000 +v 1.000000 1.000000 -1.000000 +vt 0.375000 0.000000 +vt 0.625000 0.000000 +vt 0.625000 0.250000 +vt 0.375000 0.250000 +vt 0.625000 0.500000 +vt 0.375000 0.500000 +vt 0.625000 0.750000 +vt 0.375000 0.750000 +vt 0.625000 1.000000 +vt 0.375000 1.000000 +vt 0.125000 0.500000 +vt 0.125000 0.750000 +vt 0.875000 0.500000 +vt 0.875000 0.750000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 1.0000 0.0000 +usemtl None +s off +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 3/4/2 4/3/2 8/5/2 7/6/2 +f 7/6/3 8/5/3 6/7/3 5/8/3 +f 5/8/4 6/7/4 2/9/4 1/10/4 +f 3/11/5 7/6/5 5/8/5 1/12/5 +f 8/5/6 4/13/6 2/14/6 6/7/6 diff --git a/assets/cube.png b/assets/cube.png Binary files differnew file mode 100644 index 0000000..413a785 --- /dev/null +++ b/assets/cube.png diff --git a/assets/dodecahedron.mtl b/assets/dodecahedron.mtl new file mode 100644 index 0000000..f231bdf --- /dev/null +++ b/assets/dodecahedron.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/assets/dodecahedron.obj b/assets/dodecahedron.obj new file mode 100644 index 0000000..9378634 --- /dev/null +++ b/assets/dodecahedron.obj @@ -0,0 +1,216 @@ +# Blender v3.4.1 OBJ File: '' +# www.blender.org +mtllib dodecahedron.mtl +o Circle +v 0.000000 0.000000 0.000000 +v -0.000000 -0.000000 -1.000000 +v -0.951057 0.000000 -0.309017 +v -0.587785 0.000000 0.809017 +v 0.587785 0.000000 0.809017 +v 0.951057 0.000000 -0.309017 +v -0.951060 1.618035 -1.309021 +v -0.000001 1.000000 -1.618033 +v -0.000005 -0.000000 -1.000000 +v -0.951065 -0.000000 -0.309022 +v -1.538849 1.000000 -0.500007 +v -0.688196 0.723607 -0.947217 +v 0.000002 1.000000 -1.618033 +v 0.951057 1.618035 -1.309011 +v 1.538839 1.000001 -0.499991 +v 0.951053 -0.000000 -0.309012 +v -0.000000 -0.000000 -1.000000 +v 0.688190 0.723607 -0.947210 +v 1.113522 0.723607 0.361803 +v 1.538852 1.000000 -0.499999 +v 0.951066 -0.000000 -0.309018 +v 0.587789 -0.000000 0.809014 +v 0.951057 1.000000 1.309016 +v 1.538846 1.618035 0.500001 +v 0.000000 1.618035 1.618039 +v -0.951055 1.000000 1.309017 +v -0.587781 -0.000000 0.809020 +v 0.587790 -0.000000 0.809026 +v 0.951058 1.000000 1.309027 +v 0.000002 0.723607 1.170826 +v -1.113521 0.723607 0.361807 +v -0.951065 1.000000 1.309022 +v -0.587792 -0.000000 0.809024 +v -0.951058 -0.000000 -0.309012 +v -1.538842 1.000000 -0.499998 +v -1.538846 1.618035 0.500002 +v 0.000000 2.618035 0.000000 +v 0.000000 2.618035 1.000000 +v 0.951057 2.618035 0.309017 +v 0.587785 2.618035 -0.809017 +v -0.587785 2.618035 -0.809017 +v -0.951057 2.618035 0.309017 +v 0.951060 1.000000 1.309021 +v 0.000002 1.618035 1.618033 +v 0.000005 2.618035 1.000000 +v 0.951065 2.618035 0.309022 +v 1.538849 1.618035 0.500007 +v 0.688196 1.894428 0.947217 +v -0.000002 1.618035 1.618033 +v -0.951057 1.000000 1.309011 +v -1.538839 1.618035 0.499992 +v -0.951053 2.618035 0.309012 +v 0.000000 2.618035 1.000000 +v -0.688190 1.894428 0.947210 +v -1.113522 1.894428 -0.361803 +v -1.538852 1.618035 0.499999 +v -0.951066 2.618035 0.309018 +v -0.587789 2.618035 -0.809014 +v -0.951058 1.618035 -1.309015 +v -1.538846 1.000000 -0.500001 +v -0.000001 1.000000 -1.618039 +v 0.951055 1.618035 -1.309017 +v 0.587781 2.618035 -0.809020 +v -0.587790 2.618035 -0.809026 +v -0.951058 1.618035 -1.309027 +v -0.000002 1.894428 -1.170826 +v 1.113521 1.894428 -0.361807 +v 0.951065 1.618035 -1.309022 +v 0.587792 2.618035 -0.809024 +v 0.951058 2.618035 0.309012 +v 1.538842 1.618035 0.499998 +v 1.538846 1.000000 -0.500002 +vt 0.126156 0.755207 +vt 0.126156 0.865811 +vt 0.020966 0.789385 +vt 0.061145 0.665727 +vt 0.191167 0.665727 +vt 0.231347 0.789385 +vt 0.133793 0.507300 +vt 0.198805 0.417820 +vt 0.238984 0.541479 +vt 0.133793 0.617904 +vt 0.028603 0.541479 +vt 0.068782 0.417820 +vt 0.629231 0.466888 +vt 0.694242 0.377408 +vt 0.734421 0.501067 +vt 0.629231 0.577492 +vt 0.524040 0.501067 +vt 0.564220 0.377408 +vt 0.382101 0.246545 +vt 0.382101 0.357149 +vt 0.276910 0.280723 +vt 0.487291 0.280723 +vt 0.317090 0.157065 +vt 0.447112 0.157065 +vt 0.124232 0.237885 +vt 0.189243 0.148405 +vt 0.229422 0.272063 +vt 0.019042 0.272063 +vt 0.059221 0.148405 +vt 0.124232 0.348489 +vt 0.376328 0.742077 +vt 0.376328 0.852680 +vt 0.271137 0.776255 +vt 0.311316 0.652596 +vt 0.441339 0.652596 +vt 0.481518 0.776255 +vt 0.624574 0.728606 +vt 0.624574 0.839209 +vt 0.519384 0.762784 +vt 0.559563 0.639125 +vt 0.689586 0.639125 +vt 0.729765 0.762784 +vt 0.628423 0.230188 +vt 0.693434 0.140707 +vt 0.733613 0.264366 +vt 0.628423 0.340791 +vt 0.523233 0.264366 +vt 0.563412 0.140707 +vt 0.872821 0.466888 +vt 0.937832 0.377408 +vt 0.978012 0.501067 +vt 0.872821 0.577492 +vt 0.767631 0.501067 +vt 0.807810 0.377408 +vt 0.867048 0.726681 +vt 0.867048 0.837285 +vt 0.761858 0.760860 +vt 0.972238 0.760860 +vt 0.802037 0.637201 +vt 0.932059 0.637201 +vt 0.867048 0.234036 +vt 0.932059 0.144556 +vt 0.972238 0.268215 +vt 0.761858 0.268215 +vt 0.802037 0.144556 +vt 0.867048 0.344640 +vt 0.382101 0.466888 +vt 0.382101 0.577492 +vt 0.276910 0.501067 +vt 0.317090 0.377408 +vt 0.447112 0.377408 +vt 0.487291 0.501067 +vn 0.0000 1.0000 -0.0000 +vn 0.5257 0.4472 0.7236 +vn -0.5257 0.4472 0.7236 +vn -0.8506 0.4472 -0.2764 +vn 0.0000 0.4472 -0.8944 +vn 0.8507 0.4472 -0.2764 +usemtl None +s off +f 1/1/1 2/2/1 3/3/1 +f 1/1/1 3/3/1 4/4/1 +f 1/1/1 4/4/1 5/5/1 +f 1/1/1 5/5/1 6/6/1 +f 1/1/1 6/6/1 2/2/1 +f 12/7/2 8/8/2 7/9/2 +f 12/7/2 7/9/2 11/10/2 +f 12/7/2 10/11/2 9/12/2 +f 12/7/2 11/10/2 10/11/2 +f 12/7/2 9/12/2 8/8/2 +f 18/13/3 14/14/3 13/15/3 +f 18/13/3 13/15/3 17/16/3 +f 18/13/3 16/17/3 15/18/3 +f 18/13/3 17/16/3 16/17/3 +f 18/13/3 15/18/3 14/14/3 +f 19/19/4 20/20/4 21/21/4 +f 19/19/4 24/22/4 20/20/4 +f 19/19/4 21/21/4 22/23/4 +f 19/19/4 23/24/4 24/22/4 +f 19/19/4 22/23/4 23/24/4 +f 30/25/5 26/26/5 25/27/5 +f 30/25/5 28/28/5 27/29/5 +f 30/25/5 27/29/5 26/26/5 +f 30/25/5 29/30/5 28/28/5 +f 30/25/5 25/27/5 29/30/5 +f 31/31/6 32/32/6 33/33/6 +f 31/31/6 34/34/6 35/35/6 +f 31/31/6 36/36/6 32/32/6 +f 31/31/6 35/35/6 36/36/6 +f 31/31/6 33/33/6 34/34/6 +f 37/37/1 38/38/1 39/39/1 +f 37/37/1 39/39/1 40/40/1 +f 37/37/1 40/40/1 41/41/1 +f 37/37/1 41/41/1 42/42/1 +f 37/37/1 42/42/1 38/38/1 +f 48/43/2 44/44/2 43/45/2 +f 48/43/2 43/45/2 47/46/2 +f 48/43/2 46/47/2 45/48/2 +f 48/43/2 47/46/2 46/47/2 +f 48/43/2 45/48/2 44/44/2 +f 54/49/3 50/50/3 49/51/3 +f 54/49/3 49/51/3 53/52/3 +f 54/49/3 52/53/3 51/54/3 +f 54/49/3 53/52/3 52/53/3 +f 54/49/3 51/54/3 50/50/3 +f 55/55/4 56/56/4 57/57/4 +f 55/55/4 60/58/4 56/56/4 +f 55/55/4 57/57/4 58/59/4 +f 55/55/4 59/60/4 60/58/4 +f 55/55/4 58/59/4 59/60/4 +f 66/61/5 62/62/5 61/63/5 +f 66/61/5 64/64/5 63/65/5 +f 66/61/5 63/65/5 62/62/5 +f 66/61/5 65/66/5 64/64/5 +f 66/61/5 61/63/5 65/66/5 +f 67/67/6 68/68/6 69/69/6 +f 67/67/6 70/70/6 71/71/6 +f 67/67/6 72/72/6 68/68/6 +f 67/67/6 71/71/6 72/72/6 +f 67/67/6 69/69/6 70/70/6 diff --git a/assets/dodecahedron.png b/assets/dodecahedron.png Binary files differnew file mode 100644 index 0000000..9e8d18c --- /dev/null +++ b/assets/dodecahedron.png diff --git a/assets/icosahedron.mtl b/assets/icosahedron.mtl new file mode 100644 index 0000000..46bc110 --- /dev/null +++ b/assets/icosahedron.mtl @@ -0,0 +1,2 @@ +# Blender 3.4.1 MTL File: 'None' +# www.blender.org diff --git a/assets/icosahedron.obj b/assets/icosahedron.obj new file mode 100644 index 0000000..4253bc0 --- /dev/null +++ b/assets/icosahedron.obj @@ -0,0 +1,79 @@ +# Blender 3.4.1 +# www.blender.org +mtllib icosahedron.mtl +o Icosphere +v 0.000000 -1.000000 0.000000 +v 0.723600 -0.447215 0.525720 +v -0.276385 -0.447215 0.850640 +v -0.894425 -0.447215 0.000000 +v -0.276385 -0.447215 -0.850640 +v 0.723600 -0.447215 -0.525720 +v 0.276385 0.447215 0.850640 +v -0.723600 0.447215 0.525720 +v -0.723600 0.447215 -0.525720 +v 0.276385 0.447215 -0.850640 +v 0.894425 0.447215 0.000000 +v 0.000000 1.000000 0.000000 +vn 0.1876 -0.7947 0.5774 +vn 0.6071 -0.7947 -0.0000 +vn -0.4911 -0.7947 0.3568 +vn -0.4911 -0.7947 -0.3568 +vn 0.1876 -0.7947 -0.5774 +vn 0.9822 -0.1876 -0.0000 +vn 0.3035 -0.1876 0.9342 +vn -0.7946 -0.1876 0.5774 +vn -0.7946 -0.1876 -0.5774 +vn 0.3035 -0.1876 -0.9342 +vn 0.7946 0.1876 0.5774 +vn -0.3035 0.1876 0.9342 +vn -0.9822 0.1876 -0.0000 +vn -0.3035 0.1876 -0.9342 +vn 0.7946 0.1876 -0.5774 +vn 0.4911 0.7947 0.3568 +vn -0.1876 0.7947 0.5774 +vn -0.6071 0.7947 -0.0000 +vn -0.1876 0.7947 -0.5774 +vn 0.4911 0.7947 -0.3568 +vt 0.181819 0.000000 +vt 0.363637 0.000000 +vt 0.909091 0.000000 +vt 0.727273 0.000000 +vt 0.545455 0.000000 +vt 0.272728 0.157461 +vt 1.000000 0.157461 +vt 0.090910 0.157461 +vt 0.818182 0.157461 +vt 0.636364 0.157461 +vt 0.454546 0.157461 +vt 0.181819 0.314921 +vt 0.000000 0.314921 +vt 0.909091 0.314921 +vt 0.727273 0.314921 +vt 0.545455 0.314921 +vt 0.363637 0.314921 +vt 0.272728 0.472382 +vt 0.090910 0.472382 +vt 0.818182 0.472382 +vt 0.636364 0.472382 +vt 0.454546 0.472382 +s 0 +f 1/1/1 2/6/1 3/8/1 +f 2/6/2 1/2/2 6/11/2 +f 1/3/3 3/7/3 4/9/3 +f 1/4/4 4/9/4 5/10/4 +f 1/5/5 5/10/5 6/11/5 +f 2/6/6 6/11/6 11/17/6 +f 3/8/7 2/6/7 7/12/7 +f 4/9/8 3/7/8 8/14/8 +f 5/10/9 4/9/9 9/15/9 +f 6/11/10 5/10/10 10/16/10 +f 2/6/11 11/17/11 7/12/11 +f 3/8/12 7/12/12 8/13/12 +f 4/9/13 8/14/13 9/15/13 +f 5/10/14 9/15/14 10/16/14 +f 6/11/15 10/16/15 11/17/15 +f 7/12/16 11/17/16 12/18/16 +f 8/13/17 7/12/17 12/19/17 +f 9/15/18 8/14/18 12/20/18 +f 10/16/19 9/15/19 12/21/19 +f 11/17/20 10/16/20 12/22/20 diff --git a/assets/icosahedron.png b/assets/icosahedron.png Binary files differnew file mode 100644 index 0000000..47c48f4 --- /dev/null +++ b/assets/icosahedron.png diff --git a/assets/octohedron.mtl b/assets/octohedron.mtl new file mode 100644 index 0000000..f231bdf --- /dev/null +++ b/assets/octohedron.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/assets/octohedron.obj b/assets/octohedron.obj new file mode 100644 index 0000000..424d8a8 --- /dev/null +++ b/assets/octohedron.obj @@ -0,0 +1,32 @@ +# Blender v3.4.1 OBJ File: '' +# www.blender.org +mtllib octohedron.mtl +o Circle_Circle.001 +v 0.707135 0.000000 -0.707091 +v 0.000003 1.003216 0.000014 +v -0.707125 0.000000 -0.707121 +v -0.707107 0.000000 0.707107 +v 0.707164 0.000000 0.707116 +v 0.000003 -1.003216 0.000014 +vt 0.250045 0.749962 +vt 0.500014 0.999929 +vt 0.000076 0.999925 +vt 0.500010 0.500000 +vt 0.000071 0.500000 +vt 0.000076 0.000075 +vt 0.250045 0.250038 +vt 0.500014 0.000071 +vn -0.0000 -0.5761 0.8174 +vn 0.8174 -0.5761 -0.0000 +vn 0.0000 -0.5761 -0.8174 +vn -0.8174 -0.5761 0.0000 +usemtl None +s off +f 2/1/1 3/2/1 1/3/1 +f 3/2/2 2/1/2 4/4/2 +f 2/1/3 5/5/3 4/4/3 +f 1/3/4 5/5/4 2/1/4 +f 1/6/2 5/5/2 6/7/2 +f 3/8/4 6/7/4 4/4/4 +f 6/7/3 3/8/3 1/6/3 +f 6/7/1 5/5/1 4/4/1 diff --git a/assets/octohedron.png b/assets/octohedron.png Binary files differnew file mode 100644 index 0000000..63c70b2 --- /dev/null +++ b/assets/octohedron.png diff --git a/assets/tetrahedron.mtl b/assets/tetrahedron.mtl new file mode 100644 index 0000000..f231bdf --- /dev/null +++ b/assets/tetrahedron.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/assets/tetrahedron.obj b/assets/tetrahedron.obj new file mode 100644 index 0000000..b4ba6ed --- /dev/null +++ b/assets/tetrahedron.obj @@ -0,0 +1,24 @@ +# Blender v3.4.1 OBJ File: '' +# www.blender.org +mtllib tetrahedron.mtl +o Circle_Circle.002 +v -0.000000 -0.497806 -1.000000 +v -0.866025 -0.497806 0.500000 +v 0.866025 -0.497806 0.500000 +v 0.000000 0.916407 0.000000 +vt 0.433025 0.250046 +vt 0.433025 0.749954 +vt 0.865957 0.500000 +vt 0.865957 0.999907 +vt 0.865957 0.000093 +vt 0.000093 0.500000 +vn 0.0000 1.0000 0.0000 +vn 0.0000 0.3333 0.9428 +vn 0.8165 0.3333 -0.4714 +vn -0.8165 0.3333 -0.4714 +usemtl None +s off +f 1/1/1 2/2/1 3/3/1 +f 4/4/2 2/2/2 3/3/2 +f 4/5/3 3/3/3 1/1/3 +f 4/6/4 1/1/4 2/2/4 diff --git a/assets/tetrahedron.png b/assets/tetrahedron.png Binary files differnew file mode 100644 index 0000000..f362f71 --- /dev/null +++ b/assets/tetrahedron.png diff --git a/honey/std.lua b/honey/std.lua new file mode 100644 index 0000000..923c66a --- /dev/null +++ b/honey/std.lua @@ -0,0 +1,3 @@ +local window = require 'honey.window' + +honey.Window = window.Window diff --git a/honey/window.lua b/honey/window.lua new file mode 100644 index 0000000..204f8e4 --- /dev/null +++ b/honey/window.lua @@ -0,0 +1,157 @@ +local window = {} +local glfw = honey.glfw +setmetatable(window, {__index=_G}) +setfenv(1, window) + + +Window = {} +Window.__index = Window + + +function Window.new(_, width, height, title, monitor, share) + local monitor = monitor or glfw.monitor_NULL + local share = share or glfw.window_NULL + + local self = {} + setmetatable(self, Window) + + self.win = glfw.CreateWindow(width, height, title, monitor, share) + self.__gc = honey.util.gc_canary(function() + print("destroying window " .. tostring(self.win)) + glfw.DestroyWindow(self.win) + end) + + return self +end +setmetatable(Window, {__call=Window.new}) + + +function Window.shouldClose(self) + return glfw.WindowShouldClose(self.win) == glfw.TRUE +end +function Window.setShouldClose(self, state) + glfw.SetWindowShouldClose(self.win, state) +end + + +function Window.setTitle(self, title) + glfw.SetWindowTitle(self.win, title) +end + + +function Window.getPos(self) + return glfw.GetWindowPos(self.win) +end +function Window.setPos(self, x, y) + glfw.SetWindowPos(self.win, x, y) +end + + +function Window.getSize(self) + return glfw.GetWindowSize(self.win) +end +function Window.setSizeLimits(self, minwidth, minheight, maxwidth, maxheight) + glfw.SetWindowSizeLimits(self.win, minwidth, minheight, maxwidth, maxheight) +end +function Window.setAspectRatio(self, numerator, denominator) + glfw.SetWindowAspectRatio(self.win, numerator, denominator) +end +function Window.setSize(self, width, height) + glfw.SetWindowSize(self.win, width, height) +end + + +function Window.getFramebufferSize(self) + return glfw.GetFramebufferSize(self.win) +end +function Window.getFrameSize(self) + return glfw.GetWindowFrameSize(self.win) +end + +function Window.getContentScale(self) + return glfw.GetWindowContentScale(self.win) +end + + +function Window.getOpacity(self) + return glfw.GetWindowOpacity(self.win) +end +function Window.setOpacity(self, opacity) + return glfw.SetWindowOpacity(self.win, opacity) +end + + +function Window.iconify(self) + return glfw.IconityWindow(self.win) +end +function Window.restore(self) + return glfw.RestoreWindow(self.win) +end +function Window.maximize(self) + return glfw.MaximizeWindow(self.win) +end +function Window.show(self) + return glfw.ShowWindow(self.win) +end +function Window.hide(self) + return glfw.HideWindow(self.win) +end +function Window.focus(self) + return glfw.FocusWindow(self.win) +end +function Window.requestAttention(self) + return glfw.RequestWindowAttention(self.win) +end + + +function Window.getMonitor(self) + return glfw.GetWindowMonitor(self.win) +end +function Window.setMonitor(self, monitor, xpos, ypos, width, height, refreshRate) + return glfw.SetWindowMonitor(self.win, monitor, xpos, ypos, width, height, refreshRate) +end + + +function Window.getAttrib(self, attrib) + return glfw.GetWindowAttrib(self.win, attrib) +end +function Window.setAttrib(self, attrib, value) + return glfw.SetWindowAttrib(self.win, attrib, value) +end + + +function Window.setPositionCallback(self, cb) + return glfw.SetWindowPosCallback(self.win, cb) +end +function Window.setSizeCallback(self, cb) + return glfw.SetWindowSizeCallback(self.win, cb) +end +function Window.setCloseCallback(self, cb) + return glfw.SetWindowCloseCallback(self.win, cb) +end +function Window.setRefreshCallback(self, cb) + return glfw.SetWindowRefreshCallback(self.win, cb) +end +function Window.setFocusCallback(self, cb) + return glfw.SetWindowFocusCallback(self.win, cb) +end +function Window.setIconifyCallback(self, cb) + return glfw.SetWindowIconifyCallback(self.win, cb) +end +function Window.setMaximizeCallback(self, cb) + return glfw.SetWindowIconifyCallback(self.win, cb) +end +function Window.setFramebufferSizeCallback(self, cb) + return glfw.SetFramebufferSizeCallback(self.win, cb) +end +function Window.setContentScaleCallback(self, cb) + return glfw.SetContentScaleCallback(self.win, cb) +end + + +function Window.SwapBuffers(self) + glfw.SwapBuffers(self.win) +end + + +return window diff --git a/main.lua b/main.lua new file mode 100644 index 0000000..991e8d1 --- /dev/null +++ b/main.lua @@ -0,0 +1,10 @@ +require 'honey.std' + + +honey.glfw.Init() +local window = honey.Window(640, 480, "geometry") + +while not window:shouldClose() do + print(window:getSize()) + honey.glfw.PollEvents() +end |