diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2018-12-10 20:53:50 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2018-12-10 20:53:50 +0100 |
commit | 9fae9dfbc12525cdba4451d92f93c66bb6077b35 (patch) | |
tree | db5d05f0146d836bb7d6e793d12b01defbba1b7c /AmpelJonas/main.cpp | |
parent | 4e44cec4a2a29cfee132bbe1ee722fbc5168db87 (diff) | |
download | termgl-9fae9dfbc12525cdba4451d92f93c66bb6077b35.tar.gz |
Fixes, automatic resize(linux)
Diffstat (limited to 'AmpelJonas/main.cpp')
-rw-r--r-- | AmpelJonas/main.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/AmpelJonas/main.cpp b/AmpelJonas/main.cpp index adf9113..343a688 100644 --- a/AmpelJonas/main.cpp +++ b/AmpelJonas/main.cpp @@ -1,8 +1,36 @@ +#include <unistd.h> + #include "cRender.h" #include "cObject.h" #include "cObjectHandler.h" int main() { + cRender a(' ', _COL_DEFAULT, 10,10); + cObjectHandler b(&a); + cObject x(1,1); + + int i = b.createObject(&x); + int dir1 = 1; + int dir2 = -1; + int cntr = 0; + + b.moveObject(i, {0,30}, _MOVE_ABSOULUTE); + x.drawPoint('X', {0,0}, true,_COL_GREEN); + while(1) + { + b.moveObject(i, {2 * dir1, 1 * dir2}, _MOVE_RELATIVE); + + b.write(); + a.render(); + //usleep(10*1000); + + if(x.getPosition().x <= 0 || x.getPosition().x >= a.getSize().x - 1) + dir1 *= -1; + if(x.getPosition().y <= 0 || x.getPosition().y >= a.getSize().y) + dir2 *= -1; + } + + a.render(); return 0; } |