summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jonas <himself@jonasgunz.de> 2019-01-18 13:40:55 +0100
committerGravatar jonas <himself@jonasgunz.de> 2019-01-18 13:40:55 +0100
commite2063723f9dcd32cabd5f2441228fd1539799a75 (patch)
tree3a1ffa6f3f4d932254f6279c8be435d7cba58b23
parent87c464e52d15e96b31684aa35985ea7cb1ad1b66 (diff)
downloadtermgl-e2063723f9dcd32cabd5f2441228fd1539799a75.tar.gz
Fixes in demo
-rw-r--r--Makefile2
-rw-r--r--main.cpp28
2 files changed, 15 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 0335cd6..3ec472f 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ run: debug
genversion:
@echo Building Version
- @echo "//Generated my MAKEFILE. DO NOT Edit." > version.h
+ @echo "//Generated by MAKEFILE. DO NOT Edit." > version.h
@echo "#pragma once" >> version.h
@echo "#define VERSION $(VERSION)" >> version.h
@echo "#define PATCHLEVEL $(PATCHLEVEL)" >> version.h
diff --git a/main.cpp b/main.cpp
index 3e47996..49670c4 100644
--- a/main.cpp
+++ b/main.cpp
@@ -22,7 +22,6 @@ int main()
render.render();
-
/*int iobj = handler.createObject((cObject*)&obj);
handler.moveObject(iobj, {40,10}, _MOVE_ABSOLUTE);*/
@@ -54,12 +53,7 @@ int main()
obj.addVector({0,y,0}, {x,0,0}, ',', _COL_RED);
obj.addVector({x,0,0}, {0,y,0}, ',', _COL_RED);
- handler.write();
- obj.setPosition(2,2,0);
- obj.write(&render);
-
- render.render();
sCoord3d position = {0,0,0};
while(1)
{
@@ -73,21 +67,18 @@ int main()
{
case 'A'://up
position.y --;
- obj.setPosition(position);
break;
case 'B'://down
position.y ++;
- obj.setPosition(position);
break;
case 'C'://right
position.x ++;
- obj.setPosition(position);
break;
case 'D'://left
position.x --;
- obj.setPosition(position);
break;
};
+ obj.setPosition(position);
}
else if (ie.type == _EVENT_MOUSE)
{
@@ -96,17 +87,26 @@ int main()
}
else if (ie.type == _EVENT_CHAR)
{
- handler.charEvent(ie.c);
+ //handler.charEvent(ie.c);
+ switch(ie.c)
+ {
+ case 'w':
+ position.z++;
+ break;
+ case 's':
+ position.z--;
+ break;
+ };
+ obj.setPosition(position);
}
else if (ie.type == _EVENT_TERM)
{
return 0;
}
- handler.write();
- obj.write(&render);
-
}
+ handler.write();
+ obj.write(&render);
render.render();
usleep(10*1000);
}