diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-04-16 22:16:44 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-04-16 22:16:44 +0300 |
commit | f902b289c2a3956176fc328afb31ea4fc91f8984 (patch) | |
tree | da71d4ee7ff0c5dd499631ccf8ff3201fcad70ef /kmscube/cube-null.cpp | |
parent | d54a6e8e8a170591d6eb98c8e2d4236763258f5d (diff) |
kmscube: split into parts
Diffstat (limited to 'kmscube/cube-null.cpp')
-rw-r--r-- | kmscube/cube-null.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/kmscube/cube-null.cpp b/kmscube/cube-null.cpp new file mode 100644 index 0000000..42f2ac2 --- /dev/null +++ b/kmscube/cube-null.cpp @@ -0,0 +1,36 @@ +#include <poll.h> + +#include "cube-egl.h" +#include "cube-gles2.h" +#include "cube.h" + +#include "test.h" + +using namespace std; + +void main_null() +{ + EglState egl(EGL_DEFAULT_DISPLAY); + EglSurface surface(egl, 0); + GlScene scene; + + scene.set_viewport(600, 600); + + int framenum = 0; + + struct pollfd fds[1] = { 0 }; + fds[0].fd = 0; + fds[0].events = POLLIN; + + while (true) { + int r = poll(fds, ARRAY_SIZE(fds), 0); + ASSERT(r >= 0); + + if (fds[0].revents) + break; + + surface.make_current(); + scene.draw(framenum++); + surface.swap_buffers(); + } +} |