aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libjin-lua/embed/graphics.lua.h230
-rw-r--r--src/libjin-lua/embed/scripts/graphics/graphics.lua4
-rw-r--r--src/libjin/graphics/je_graphic.h4
-rw-r--r--src/libjin/graphics/je_mesh.cpp18
-rw-r--r--src/libjin/graphics/je_vertex.h8
-rw-r--r--src/libjin/graphics/je_window.h4
-rw-r--r--src/libjin/math/je_matrix.cpp7
-rw-r--r--src/libjin/math/je_vector2.hpp14
8 files changed, 149 insertions, 140 deletions
diff --git a/src/libjin-lua/embed/graphics.lua.h b/src/libjin-lua/embed/graphics.lua.h
index 071d862..463e08d 100644
--- a/src/libjin-lua/embed/graphics.lua.h
+++ b/src/libjin-lua/embed/graphics.lua.h
@@ -21,29 +21,15 @@ static unsigned char graphics_lua[] = {
73,78,71,76,69,32,61,32,49,44,13,10,32,32,32,32,82,65,78,68,
79,77,32,61,32,50,44,13,10,32,32,32,32,65,78,73,77,65,84,69,
68,32,61,32,51,13,10,125,13,10,13,10,45,45,32,66,117,105,108,116,
-32,105,110,32,115,104,97,100,101,114,115,13,10,106,103,46,83,104,97,100,
-101,114,115,32,61,32,110,105,108,13,10,108,111,99,97,108,32,102,117,110,
-99,116,105,111,110,32,99,111,109,112,105,108,101,66,117,105,108,116,73,110,
-83,104,97,100,101,114,115,40,41,32,13,10,32,32,32,32,105,102,32,106,
-103,46,83,104,97,100,101,114,115,32,126,61,32,110,105,108,32,116,104,101,
-110,32,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,13,10,
-32,32,32,32,101,110,100,13,10,32,32,32,32,106,103,46,83,104,97,100,
-101,114,115,32,61,32,123,125,13,10,9,106,103,46,83,104,97,100,101,114,
-115,46,70,111,110,116,32,61,32,106,103,46,110,101,119,83,104,97,100,101,
-114,91,91,13,10,9,9,35,86,69,82,84,69,88,95,83,72,65,68,69,
-82,13,10,9,9,86,101,114,116,101,120,32,118,101,114,116,40,86,101,114,
-116,101,120,32,118,41,13,10,9,9,123,13,10,9,9,9,114,101,116,117,
-114,110,32,118,59,13,10,9,9,125,13,10,9,9,35,69,78,68,95,86,
-69,82,84,69,88,95,83,72,65,68,69,82,13,10,9,9,35,70,82,65,
-71,77,69,78,84,95,83,72,65,68,69,82,13,10,9,9,67,111,108,111,
-114,32,102,114,97,103,40,67,111,108,111,114,32,99,111,108,44,32,84,101,
-120,116,117,114,101,32,116,101,120,44,32,86,101,114,116,101,120,32,118,41,
-13,10,9,9,123,13,10,9,9,9,114,101,116,117,114,110,32,67,111,108,
-111,114,40,99,111,108,46,114,103,98,44,32,116,101,120,101,108,40,116,101,
-120,44,32,118,46,117,118,41,46,97,41,59,13,10,9,9,125,13,10,9,
-9,35,69,78,68,95,70,82,65,71,77,69,78,84,95,83,72,65,68,69,
-82,13,10,9,93,93,13,10,9,106,103,46,83,104,97,100,101,114,115,46,
-84,101,120,116,117,114,101,32,61,32,106,103,46,110,101,119,83,104,97,100,
+32,105,110,32,115,104,97,100,101,114,115,46,13,10,106,103,46,83,104,97,
+100,101,114,115,32,61,32,110,105,108,13,10,108,111,99,97,108,32,102,117,
+110,99,116,105,111,110,32,99,111,109,112,105,108,101,66,117,105,108,116,73,
+110,83,104,97,100,101,114,115,40,41,32,13,10,32,32,32,32,105,102,32,
+106,103,46,83,104,97,100,101,114,115,32,126,61,32,110,105,108,32,116,104,
+101,110,32,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,13,
+10,32,32,32,32,101,110,100,13,10,32,32,32,32,106,103,46,83,104,97,
+100,101,114,115,32,61,32,123,125,13,10,9,106,103,46,83,104,97,100,101,
+114,115,46,70,111,110,116,32,61,32,106,103,46,110,101,119,83,104,97,100,
101,114,91,91,13,10,9,9,35,86,69,82,84,69,88,95,83,72,65,68,
69,82,13,10,9,9,86,101,114,116,101,120,32,118,101,114,116,40,86,101,
114,116,101,120,32,118,41,13,10,9,9,123,13,10,9,9,9,114,101,116,
@@ -52,25 +38,12 @@ static unsigned char graphics_lua[] = {
65,71,77,69,78,84,95,83,72,65,68,69,82,13,10,9,9,67,111,108,
111,114,32,102,114,97,103,40,67,111,108,111,114,32,99,111,108,44,32,84,
101,120,116,117,114,101,32,116,101,120,44,32,86,101,114,116,101,120,32,118,
-41,13,10,9,9,123,13,10,9,9,9,114,101,116,117,114,110,32,99,111,
-108,32,42,32,116,101,120,101,108,40,116,101,120,44,32,118,46,117,118,41,
-59,13,10,9,9,125,13,10,9,9,35,69,78,68,95,70,82,65,71,77,
-69,78,84,95,83,72,65,68,69,82,13,10,9,93,93,13,10,9,106,103,
-46,83,104,97,100,101,114,115,46,83,112,114,105,116,101,32,61,32,106,103,
-46,110,101,119,83,104,97,100,101,114,91,91,13,10,9,9,35,86,69,82,
-84,69,88,95,83,72,65,68,69,82,13,10,9,9,86,101,114,116,101,120,
-32,118,101,114,116,40,86,101,114,116,101,120,32,118,41,13,10,9,9,123,
-13,10,9,9,9,114,101,116,117,114,110,32,118,59,13,10,9,9,125,13,
-10,9,9,35,69,78,68,95,86,69,82,84,69,88,95,83,72,65,68,69,
-82,13,10,9,9,35,70,82,65,71,77,69,78,84,95,83,72,65,68,69,
-82,13,10,9,9,67,111,108,111,114,32,102,114,97,103,40,67,111,108,111,
-114,32,99,111,108,44,32,84,101,120,116,117,114,101,32,116,101,120,44,32,
-86,101,114,116,101,120,32,118,41,13,10,9,9,123,13,10,9,9,9,114,
-101,116,117,114,110,32,99,111,108,32,42,32,116,101,120,101,108,40,116,101,
-120,44,32,118,46,117,118,41,59,13,10,9,9,125,13,10,9,9,35,69,
-78,68,95,70,82,65,71,77,69,78,84,95,83,72,65,68,69,82,13,10,
-9,93,93,13,10,9,106,103,46,83,104,97,100,101,114,115,46,83,112,114,
-105,116,101,83,104,101,101,116,32,61,32,106,103,46,110,101,119,83,104,97,
+41,13,10,9,9,123,13,10,9,9,9,114,101,116,117,114,110,32,67,111,
+108,111,114,40,99,111,108,46,114,103,98,44,32,116,101,120,101,108,40,116,
+101,120,44,32,118,46,117,118,41,46,97,41,59,13,10,9,9,125,13,10,
+9,9,35,69,78,68,95,70,82,65,71,77,69,78,84,95,83,72,65,68,
+69,82,13,10,9,93,93,13,10,9,106,103,46,83,104,97,100,101,114,115,
+46,84,101,120,116,117,114,101,32,61,32,106,103,46,110,101,119,83,104,97,
100,101,114,91,91,13,10,9,9,35,86,69,82,84,69,88,95,83,72,65,
68,69,82,13,10,9,9,86,101,114,116,101,120,32,118,101,114,116,40,86,
101,114,116,101,120,32,118,41,13,10,9,9,123,13,10,9,9,9,114,101,
@@ -82,80 +55,107 @@ static unsigned char graphics_lua[] = {
118,41,13,10,9,9,123,13,10,9,9,9,114,101,116,117,114,110,32,99,
111,108,32,42,32,116,101,120,101,108,40,116,101,120,44,32,118,46,117,118,
41,59,13,10,9,9,125,13,10,9,9,35,69,78,68,95,70,82,65,71,
-77,69,78,84,95,83,72,65,68,69,82,13,10,9,93,93,13,10,32,32,
-32,32,106,103,46,83,104,97,100,101,114,115,46,83,104,97,112,101,32,61,
-32,106,103,46,110,101,119,83,104,97,100,101,114,91,91,13,10,32,32,32,
-32,32,32,32,32,35,86,69,82,84,69,88,95,83,72,65,68,69,82,13,
-10,9,32,32,32,32,86,101,114,116,101,120,32,118,101,114,116,40,86,101,
-114,116,101,120,32,118,41,13,10,9,32,32,32,32,123,13,10,9,9,32,
-32,32,32,114,101,116,117,114,110,32,118,59,13,10,9,32,32,32,32,125,
-13,10,9,32,32,32,32,35,69,78,68,95,86,69,82,84,69,88,95,83,
-72,65,68,69,82,13,10,9,32,32,32,32,35,70,82,65,71,77,69,78,
-84,95,83,72,65,68,69,82,13,10,9,32,32,32,32,67,111,108,111,114,
+77,69,78,84,95,83,72,65,68,69,82,13,10,9,93,93,13,10,9,106,
+103,46,83,104,97,100,101,114,115,46,83,112,114,105,116,101,32,61,32,106,
+103,46,110,101,119,83,104,97,100,101,114,91,91,13,10,9,9,35,86,69,
+82,84,69,88,95,83,72,65,68,69,82,13,10,9,9,86,101,114,116,101,
+120,32,118,101,114,116,40,86,101,114,116,101,120,32,118,41,13,10,9,9,
+123,13,10,9,9,9,114,101,116,117,114,110,32,118,59,13,10,9,9,125,
+13,10,9,9,35,69,78,68,95,86,69,82,84,69,88,95,83,72,65,68,
+69,82,13,10,9,9,35,70,82,65,71,77,69,78,84,95,83,72,65,68,
+69,82,13,10,9,9,67,111,108,111,114,32,102,114,97,103,40,67,111,108,
+111,114,32,99,111,108,44,32,84,101,120,116,117,114,101,32,116,101,120,44,
+32,86,101,114,116,101,120,32,118,41,13,10,9,9,123,13,10,9,9,9,
+114,101,116,117,114,110,32,99,111,108,32,42,32,116,101,120,101,108,40,116,
+101,120,44,32,118,46,117,118,41,59,13,10,9,9,125,13,10,9,9,35,
+69,78,68,95,70,82,65,71,77,69,78,84,95,83,72,65,68,69,82,13,
+10,9,93,93,13,10,9,106,103,46,83,104,97,100,101,114,115,46,83,112,
+114,105,116,101,66,97,116,99,104,32,61,32,106,103,46,110,101,119,83,104,
+97,100,101,114,91,91,13,10,9,9,35,86,69,82,84,69,88,95,83,72,
+65,68,69,82,13,10,9,9,86,101,114,116,101,120,32,118,101,114,116,40,
+86,101,114,116,101,120,32,118,41,13,10,9,9,123,13,10,9,9,9,114,
+101,116,117,114,110,32,118,59,13,10,9,9,125,13,10,9,9,35,69,78,
+68,95,86,69,82,84,69,88,95,83,72,65,68,69,82,13,10,9,9,35,
+70,82,65,71,77,69,78,84,95,83,72,65,68,69,82,13,10,9,9,67,
+111,108,111,114,32,102,114,97,103,40,67,111,108,111,114,32,99,111,108,44,
+32,84,101,120,116,117,114,101,32,116,101,120,44,32,86,101,114,116,101,120,
+32,118,41,13,10,9,9,123,13,10,9,9,9,114,101,116,117,114,110,32,
+99,111,108,32,42,32,116,101,120,101,108,40,116,101,120,44,32,118,46,117,
+118,41,59,13,10,9,9,125,13,10,9,9,35,69,78,68,95,70,82,65,
+71,77,69,78,84,95,83,72,65,68,69,82,13,10,9,93,93,13,10,32,
+32,32,32,106,103,46,83,104,97,100,101,114,115,46,83,104,97,112,101,32,
+61,32,106,103,46,110,101,119,83,104,97,100,101,114,91,91,13,10,32,32,
+32,32,32,32,32,32,35,86,69,82,84,69,88,95,83,72,65,68,69,82,
+13,10,9,32,32,32,32,86,101,114,116,101,120,32,118,101,114,116,40,86,
+101,114,116,101,120,32,118,41,13,10,9,32,32,32,32,123,13,10,9,9,
+32,32,32,32,114,101,116,117,114,110,32,118,59,13,10,9,32,32,32,32,
+125,13,10,9,32,32,32,32,35,69,78,68,95,86,69,82,84,69,88,95,
+83,72,65,68,69,82,13,10,9,32,32,32,32,35,70,82,65,71,77,69,
+78,84,95,83,72,65,68,69,82,13,10,9,32,32,32,32,67,111,108,111,
+114,32,102,114,97,103,40,67,111,108,111,114,32,99,111,108,44,32,84,101,
+120,116,117,114,101,32,116,101,120,44,32,86,101,114,116,101,120,32,118,41,
+13,10,9,32,32,32,32,123,13,10,9,9,32,32,32,32,114,101,116,117,
+114,110,32,99,111,108,59,13,10,9,32,32,32,32,125,13,10,9,32,32,
+32,32,35,69,78,68,95,70,82,65,71,77,69,78,84,95,83,72,65,68,
+69,82,13,10,32,32,32,32,93,93,13,10,32,32,32,32,106,103,46,83,
+104,97,100,101,114,115,46,77,101,115,104,32,61,32,106,103,46,110,101,119,
+83,104,97,100,101,114,91,91,32,13,10,32,32,32,32,32,32,32,9,35,
+86,69,82,84,69,88,95,83,72,65,68,69,82,13,10,32,32,32,32,32,
+32,32,32,105,110,32,86,101,99,52,32,99,111,108,111,114,59,13,10,9,
+9,86,101,114,116,101,120,32,118,101,114,116,40,86,101,114,116,101,120,32,
+118,41,13,10,9,9,123,13,10,9,9,9,114,101,116,117,114,110,32,118,
+59,13,10,9,9,125,13,10,9,9,35,69,78,68,95,86,69,82,84,69,
+88,95,83,72,65,68,69,82,13,10,9,9,35,70,82,65,71,77,69,78,
+84,95,83,72,65,68,69,82,13,10,9,9,67,111,108,111,114,32,102,114,
+97,103,40,67,111,108,111,114,32,99,111,108,44,32,84,101,120,116,117,114,
+101,32,116,101,120,44,32,86,101,114,116,101,120,32,118,41,13,10,9,9,
+123,13,10,9,9,9,114,101,116,117,114,110,32,99,111,108,32,42,32,116,
+101,120,101,108,40,116,101,120,44,32,118,46,117,118,41,32,42,32,118,46,
+99,111,108,111,114,59,13,10,9,9,125,13,10,9,9,35,69,78,68,95,
+70,82,65,71,77,69,78,84,95,83,72,65,68,69,82,32,13,10,32,32,
+32,32,93,93,13,10,9,106,103,46,83,104,97,100,101,114,115,46,68,101,
+102,97,117,108,116,32,61,32,106,103,46,110,101,119,83,104,97,100,101,114,
+91,91,13,10,9,9,35,86,69,82,84,69,88,95,83,72,65,68,69,82,
+13,10,9,9,86,101,114,116,101,120,32,118,101,114,116,40,86,101,114,116,
+101,120,32,118,41,13,10,9,9,123,13,10,9,9,9,114,101,116,117,114,
+110,32,118,59,13,10,9,9,125,13,10,9,9,35,69,78,68,95,86,69,
+82,84,69,88,95,83,72,65,68,69,82,13,10,9,9,35,70,82,65,71,
+77,69,78,84,95,83,72,65,68,69,82,13,10,9,9,67,111,108,111,114,
32,102,114,97,103,40,67,111,108,111,114,32,99,111,108,44,32,84,101,120,
116,117,114,101,32,116,101,120,44,32,86,101,114,116,101,120,32,118,41,13,
-10,9,32,32,32,32,123,13,10,9,9,32,32,32,32,114,101,116,117,114,
-110,32,99,111,108,59,13,10,9,32,32,32,32,125,13,10,9,32,32,32,
-32,35,69,78,68,95,70,82,65,71,77,69,78,84,95,83,72,65,68,69,
-82,13,10,32,32,32,32,93,93,13,10,32,32,32,32,106,103,46,83,104,
-97,100,101,114,115,46,77,101,115,104,32,61,32,106,103,46,110,101,119,83,
-104,97,100,101,114,91,91,32,13,10,32,32,32,32,32,32,32,9,35,86,
-69,82,84,69,88,95,83,72,65,68,69,82,13,10,32,32,32,32,32,32,
-32,32,105,110,32,86,101,99,52,32,99,111,108,111,114,59,13,10,9,9,
-86,101,114,116,101,120,32,118,101,114,116,40,86,101,114,116,101,120,32,118,
-41,13,10,9,9,123,13,10,9,9,9,114,101,116,117,114,110,32,118,59,
-13,10,9,9,125,13,10,9,9,35,69,78,68,95,86,69,82,84,69,88,
-95,83,72,65,68,69,82,13,10,9,9,35,70,82,65,71,77,69,78,84,
-95,83,72,65,68,69,82,13,10,9,9,67,111,108,111,114,32,102,114,97,
-103,40,67,111,108,111,114,32,99,111,108,44,32,84,101,120,116,117,114,101,
-32,116,101,120,44,32,86,101,114,116,101,120,32,118,41,13,10,9,9,123,
-13,10,9,9,9,114,101,116,117,114,110,32,99,111,108,32,42,32,116,101,
-120,101,108,40,116,101,120,44,32,118,46,117,118,41,32,42,32,118,46,99,
-111,108,111,114,59,13,10,9,9,125,13,10,9,9,35,69,78,68,95,70,
-82,65,71,77,69,78,84,95,83,72,65,68,69,82,32,13,10,32,32,32,
-32,93,93,13,10,9,106,103,46,83,104,97,100,101,114,115,46,68,101,102,
-97,117,108,116,32,61,32,106,103,46,110,101,119,83,104,97,100,101,114,91,
-91,13,10,9,9,35,86,69,82,84,69,88,95,83,72,65,68,69,82,13,
-10,9,9,86,101,114,116,101,120,32,118,101,114,116,40,86,101,114,116,101,
-120,32,118,41,13,10,9,9,123,13,10,9,9,9,114,101,116,117,114,110,
-32,118,59,13,10,9,9,125,13,10,9,9,35,69,78,68,95,86,69,82,
-84,69,88,95,83,72,65,68,69,82,13,10,9,9,35,70,82,65,71,77,
-69,78,84,95,83,72,65,68,69,82,13,10,9,9,67,111,108,111,114,32,
-102,114,97,103,40,67,111,108,111,114,32,99,111,108,44,32,84,101,120,116,
-117,114,101,32,116,101,120,44,32,86,101,114,116,101,120,32,118,41,13,10,
-9,9,123,13,10,9,9,9,114,101,116,117,114,110,32,99,111,108,32,42,
-32,116,101,120,101,108,40,116,101,120,44,32,118,46,117,118,41,59,13,10,
-9,9,125,13,10,9,9,35,69,78,68,95,70,82,65,71,77,69,78,84,
-95,83,72,65,68,69,82,13,10,9,93,93,32,13,10,101,110,100,13,10,
-13,10,108,111,99,97,108,32,95,105,110,105,116,32,61,32,106,103,46,105,
-110,105,116,13,10,108,111,99,97,108,32,105,110,105,116,105,97,108,105,122,
-101,100,32,61,32,102,97,108,115,101,13,10,106,103,46,105,110,105,116,32,
-61,32,102,117,110,99,116,105,111,110,40,115,101,116,116,105,110,103,41,32,
-13,10,32,32,32,32,105,102,32,105,110,105,116,105,97,108,105,122,101,100,
-32,116,104,101,110,32,13,10,32,32,32,32,32,32,32,32,114,101,116,117,
-114,110,32,105,110,105,116,105,97,108,105,122,101,100,13,10,32,32,32,32,
-101,110,100,13,10,32,32,32,32,105,110,105,116,105,97,108,105,122,101,100,
-32,61,32,95,105,110,105,116,40,115,101,116,116,105,110,103,41,13,10,32,
-32,32,32,105,102,32,105,110,105,116,105,97,108,105,122,101,100,32,116,104,
-101,110,32,13,10,32,32,32,32,32,32,32,32,99,111,109,112,105,108,101,
-66,117,105,108,116,73,110,83,104,97,100,101,114,115,40,41,13,10,32,32,
-32,32,32,32,32,32,106,103,46,117,115,101,83,104,97,100,101,114,40,106,
-103,46,83,104,97,100,101,114,115,46,68,101,102,97,117,108,116,41,13,10,
-32,32,32,32,101,110,100,13,10,32,32,32,32,114,101,116,117,114,110,32,
-105,110,105,116,105,97,108,105,122,101,100,32,13,10,101,110,100,13,10,13,
-10,106,103,46,117,110,117,115,101,83,104,97,100,101,114,32,61,32,102,117,
-110,99,116,105,111,110,40,41,13,10,32,32,32,32,106,103,46,117,115,101,
-83,104,97,100,101,114,40,106,103,46,83,104,97,100,101,114,115,46,68,101,
-102,97,117,108,116,41,13,10,101,110,100,13,10,13,10,45,45,32,82,101,
-115,101,116,32,97,108,108,32,97,116,116,114,105,98,117,116,101,115,32,116,
-111,32,100,101,102,97,117,108,116,32,118,97,108,117,101,46,13,10,106,103,
-46,114,101,115,101,116,32,61,32,102,117,110,99,116,105,111,110,40,41,13,
-10,32,32,32,32,106,103,46,115,101,116,67,111,108,111,114,40,50,53,53,
-44,32,50,53,53,44,32,50,53,53,44,32,50,53,53,41,13,10,32,32,
-32,32,106,103,46,115,101,116,67,108,101,97,114,67,111,108,111,114,40,48,
-44,32,48,44,32,48,44,32,50,53,53,41,13,10,32,32,32,32,106,103,
-46,99,108,101,97,114,40,41,13,10,32,32,32,32,106,103,46,117,110,115,
-101,116,70,111,110,116,40,41,13,10,32,32,32,32,106,103,46,117,110,117,
-115,101,83,104,97,100,101,114,40,41,13,10,101,110,100,13,10
+10,9,9,123,13,10,9,9,9,114,101,116,117,114,110,32,99,111,108,32,
+42,32,116,101,120,101,108,40,116,101,120,44,32,118,46,117,118,41,59,13,
+10,9,9,125,13,10,9,9,35,69,78,68,95,70,82,65,71,77,69,78,
+84,95,83,72,65,68,69,82,13,10,9,93,93,32,13,10,101,110,100,13,
+10,13,10,108,111,99,97,108,32,95,105,110,105,116,32,61,32,106,103,46,
+105,110,105,116,13,10,108,111,99,97,108,32,105,110,105,116,105,97,108,105,
+122,101,100,32,61,32,102,97,108,115,101,13,10,106,103,46,105,110,105,116,
+32,61,32,102,117,110,99,116,105,111,110,40,115,101,116,116,105,110,103,41,
+32,13,10,32,32,32,32,105,102,32,105,110,105,116,105,97,108,105,122,101,
+100,32,116,104,101,110,32,13,10,32,32,32,32,32,32,32,32,114,101,116,
+117,114,110,32,105,110,105,116,105,97,108,105,122,101,100,13,10,32,32,32,
+32,101,110,100,13,10,32,32,32,32,105,110,105,116,105,97,108,105,122,101,
+100,32,61,32,95,105,110,105,116,40,115,101,116,116,105,110,103,41,13,10,
+32,32,32,32,105,102,32,105,110,105,116,105,97,108,105,122,101,100,32,116,
+104,101,110,32,13,10,32,32,32,32,32,32,32,32,99,111,109,112,105,108,
+101,66,117,105,108,116,73,110,83,104,97,100,101,114,115,40,41,13,10,32,
+32,32,32,32,32,32,32,106,103,46,117,115,101,83,104,97,100,101,114,40,
+106,103,46,83,104,97,100,101,114,115,46,68,101,102,97,117,108,116,41,13,
+10,32,32,32,32,101,110,100,13,10,32,32,32,32,114,101,116,117,114,110,
+32,105,110,105,116,105,97,108,105,122,101,100,32,13,10,101,110,100,13,10,
+13,10,106,103,46,117,110,117,115,101,83,104,97,100,101,114,32,61,32,102,
+117,110,99,116,105,111,110,40,41,13,10,32,32,32,32,106,103,46,117,115,
+101,83,104,97,100,101,114,40,106,103,46,83,104,97,100,101,114,115,46,68,
+101,102,97,117,108,116,41,13,10,101,110,100,13,10,13,10,45,45,32,82,
+101,115,101,116,32,97,108,108,32,97,116,116,114,105,98,117,116,101,115,32,
+116,111,32,100,101,102,97,117,108,116,32,118,97,108,117,101,46,13,10,106,
+103,46,114,101,115,101,116,32,61,32,102,117,110,99,116,105,111,110,40,41,
+13,10,32,32,32,32,106,103,46,115,101,116,67,111,108,111,114,40,50,53,
+53,44,32,50,53,53,44,32,50,53,53,44,32,50,53,53,41,13,10,32,
+32,32,32,106,103,46,115,101,116,67,108,101,97,114,67,111,108,111,114,40,
+48,44,32,48,44,32,48,44,32,50,53,53,41,13,10,32,32,32,32,106,
+103,46,99,108,101,97,114,40,41,13,10,32,32,32,32,106,103,46,117,110,
+115,101,116,70,111,110,116,40,41,13,10,32,32,32,32,106,103,46,117,110,
+117,115,101,83,104,97,100,101,114,40,41,13,10,101,110,100,13,10
};
diff --git a/src/libjin-lua/embed/scripts/graphics/graphics.lua b/src/libjin-lua/embed/scripts/graphics/graphics.lua
index 8b16a35..65a320f 100644
--- a/src/libjin-lua/embed/scripts/graphics/graphics.lua
+++ b/src/libjin-lua/embed/scripts/graphics/graphics.lua
@@ -26,7 +26,7 @@ jg.SpriteMode = {
ANIMATED = 3
}
--- Built in shaders
+-- Built in shaders.
jg.Shaders = nil
local function compileBuiltInShaders()
if jg.Shaders ~= nil then
@@ -75,7 +75,7 @@ local function compileBuiltInShaders()
}
#END_FRAGMENT_SHADER
]]
- jg.Shaders.SpriteSheet = jg.newShader[[
+ jg.Shaders.SpriteBatch = jg.newShader[[
#VERTEX_SHADER
Vertex vert(Vertex v)
{
diff --git a/src/libjin/graphics/je_graphic.h b/src/libjin/graphics/je_graphic.h
index f47adbf..92c7c46 100644
--- a/src/libjin/graphics/je_graphic.h
+++ b/src/libjin/graphics/je_graphic.h
@@ -42,12 +42,12 @@ namespace JinEngine
///
///
///
- inline int getWidth() const { return mSize.w; }
+ inline int getWidth() const { return mSize.w(); }
///
///
///
- inline int getHeight() const { return mSize.h; }
+ inline int getHeight() const { return mSize.h(); }
///
/// Get opengl texture token.
diff --git a/src/libjin/graphics/je_mesh.cpp b/src/libjin/graphics/je_mesh.cpp
index 4c27433..b96a4ff 100644
--- a/src/libjin/graphics/je_mesh.cpp
+++ b/src/libjin/graphics/je_mesh.cpp
@@ -24,8 +24,8 @@ namespace JinEngine
void Mesh::pushVertex(float x, float y, float u, float v, Color color)
{
Vertex vert;
- vert.x = x; vert.y = y;
- vert.u = u; vert.v = v;
+ vert.xy.x = x; vert.xy.y = y;
+ vert.uv.u = u; vert.uv.v = v;
vert.color = color;
pushVertex(vert);
}
@@ -37,14 +37,14 @@ namespace JinEngine
if (mVertices.size() == 2)
{
const Vertex& v0 = mVertices[0];
- mBound.l = min(v0.x, vert.x);
- mBound.r = max(v0.x, vert.x);
- mBound.t = min(v0.y, vert.y);
- mBound.b = max(v0.y, vert.y);
+ mBound.l = min(v0.xy.x, vert.xy.x);
+ mBound.r = max(v0.xy.x, vert.xy.x);
+ mBound.t = min(v0.xy.y, vert.xy.y);
+ mBound.b = max(v0.xy.y, vert.xy.y);
}
else
{
- float x = vert.x, y = vert.y;
+ float x = vert.xy.x, y = vert.xy.y;
mBound.l = x < mBound.l ? x : mBound.l;
mBound.r = x > mBound.r ? x : mBound.r;
mBound.t = y < mBound.t ? y : mBound.t;
@@ -63,8 +63,8 @@ namespace JinEngine
shader->sendMatrix4(SHADER_MODELVIEW_MATRIX, &modelViewMatrix);
shader->sendMatrix4(SHADER_PROJECTION_MATRIX, &gl.getProjectionMatrix());
shader->beginUploadAttributes();
- shader->uploadVertices(2, GL_FLOAT, sizeof(Vertex), &(mVertices[0].x));
- shader->uploadUV(2, GL_FLOAT, sizeof(Vertex), &(mVertices[0].u));
+ shader->uploadVertices(2, GL_FLOAT, sizeof(Vertex), &(mVertices[0].xy));
+ shader->uploadUV(2, GL_FLOAT, sizeof(Vertex), &(mVertices[0].uv));
shader->uploadColor(4, GL_UNSIGNED_BYTE, sizeof(Vertex), &(mVertices[0].color), GL_TRUE);
shader->endUploadAttributes();
diff --git a/src/libjin/graphics/je_vertex.h b/src/libjin/graphics/je_vertex.h
index d149cfc..d2b482c 100644
--- a/src/libjin/graphics/je_vertex.h
+++ b/src/libjin/graphics/je_vertex.h
@@ -1,6 +1,8 @@
#ifndef __JE_MATH_VERTEX_H__
#define __JE_MATH_VERTEX_H__
+#include "../math/je_vector2.hpp"
+
#include "je_color.h"
namespace JinEngine
@@ -10,9 +12,9 @@ namespace JinEngine
struct Vertex
{
- float x, y; // Coordinates
- float u, v; // UV
- Color color; // Color
+ Math::Vector2<float> xy;
+ Math::Vector2<float> uv;
+ Color color;
};
}
diff --git a/src/libjin/graphics/je_window.h b/src/libjin/graphics/je_window.h
index 902e873..387395e 100644
--- a/src/libjin/graphics/je_window.h
+++ b/src/libjin/graphics/je_window.h
@@ -53,12 +53,12 @@ namespace JinEngine
///
///
///
- inline int getW(){ return mSize.w; }
+ inline int getW(){ return mSize.w(); }
///
///
///
- inline int getH(){ return mSize.h; }
+ inline int getH(){ return mSize.h(); }
///
///
diff --git a/src/libjin/math/je_matrix.cpp b/src/libjin/math/je_matrix.cpp
index f422002..96eae86 100644
--- a/src/libjin/math/je_matrix.cpp
+++ b/src/libjin/math/je_matrix.cpp
@@ -184,11 +184,10 @@ namespace JinEngine
for (int i = 0; i<size; ++i)
{
// Store in temp variables in case src = dst
- float x = (e[0] * src[i].x) + (e[4] * src[i].y) + (0) + (e[12]);
- float y = (e[1] * src[i].x) + (e[5] * src[i].y) + (0) + (e[13]);
+ float x = (e[0] * src[i].xy.x) + (e[4] * src[i].xy.y) + (0) + (e[12]);
+ float y = (e[1] * src[i].xy.x) + (e[5] * src[i].xy.y) + (0) + (e[13]);
- dst[i].x = x;
- dst[i].y = y;
+ dst[i].xy.set(x, y);
}
}
diff --git a/src/libjin/math/je_vector2.hpp b/src/libjin/math/je_vector2.hpp
index 4d76987..4be30fb 100644
--- a/src/libjin/math/je_vector2.hpp
+++ b/src/libjin/math/je_vector2.hpp
@@ -58,9 +58,17 @@ namespace JinEngine
return data[0] == 0 && data[1] == 0;
}
- T &x = data[0], &y = data[1]; // xy
- T &w = data[0], &h = data[1]; // wh
- T &colum = data[0], &row = data[1]; // colum row
+ #define _aliases(A, B) \
+ T& A() { return data[0]; }\
+ T& B() { return data[1]; }\
+ T A() const { return data[0]; }\
+ T B() const { return data[1]; }
+
+ _aliases(x, y)
+ _aliases(w, h)
+ _aliases(colum, row)
+
+ #undef _aliases
private:
T data[2];