diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2019-12-13 12:33:51 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2019-12-13 12:33:51 +0100 |
commit | 4b8dba2e737ac9f41e4556546db8ed855ced80e4 (patch) | |
tree | 3b75f70d4b7b9cedb479d8526e5347c0e9403c30 /example | |
parent | 28aca76a49824d969020b383518ac429869517fa (diff) | |
download | termgl-4b8dba2e737ac9f41e4556546db8ed855ced80e4.tar.gz |
Fixes
Diffstat (limited to 'example')
-rw-r--r-- | example/pong.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/example/pong.cpp b/example/pong.cpp index 2716fa7..6bbbe3d 100644 --- a/example/pong.cpp +++ b/example/pong.cpp @@ -1,7 +1,4 @@ -#include <cRender.h> -#include <cObject.h> -#include <cObjectHandler.h> -#include <cInput.h> +#include <termgl.h> #include <unistd.h> class ball : public cObject @@ -115,10 +112,10 @@ int main() screen.clickEvent({ie.x, ie.y}, 0); } else if (ie.type == _EVENT_CHAR) - { + { //handler.charEvent(ie.c); switch(ie.c) - { + { case 'w': screen.moveObject(iBarLeft, {0,-1}, _MOVE_RELATIVE); break; @@ -133,6 +130,11 @@ int main() { return 0; } + else if(ie.type == _EVENT_CTRL) + { + if(ie.c == CTRL_KEY('g')) + render.enableDebugInfo(true); + } } if(!(++cc % 3)) screen.moveObject(iAball, aball.getV(), _MOVE_RELATIVE); |