• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <poll.h>
2 
3 #include "cube-egl.h"
4 #include "cube-gles2.h"
5 #include "cube.h"
6 
7 #include <kms++util/kms++util.h>
8 
9 using namespace std;
10 
main_null()11 void main_null()
12 {
13 	EglState egl(EGL_DEFAULT_DISPLAY);
14 	EglSurface surface(egl, 0);
15 	GlScene scene;
16 
17 	scene.set_viewport(600, 600);
18 
19 	int framenum = 0;
20 
21 	struct pollfd fds[1] = { };
22 	fds[0].fd = 0;
23 	fds[0].events =  POLLIN;
24 
25 	while (true) {
26 		int r = poll(fds, ARRAY_SIZE(fds), 0);
27 		ASSERT(r >= 0);
28 
29 		if (fds[0].revents)
30 			break;
31 
32 		surface.make_current();
33 		scene.draw(framenum++);
34 		surface.swap_buffers();
35 	}
36 }
37