-
Notifications
You must be signed in to change notification settings - Fork 0
/
testapp.cpp
48 lines (37 loc) · 1008 Bytes
/
testapp.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "testapp.hpp"
#include "testwindow.hpp"
#include <time.h>
#include <iostream>
#include <string>
bool TestNookApp::run()
{
const struct timespec tenthsec = {0, 100000000} ;
std::string strfilefb("/dev/graphics/fb0") ;
std::string strRefresh("/sys/class/graphics/fb0/epd_refresh") ;
if (!init_display(strfilefb,strRefresh)){
std::cerr << "Cannot open display " << strfilefb << std::endl;
return false ;
}
if (!init_inputs("/dev/input")){
std::cerr << "Failed to initialise the input events\n" ;
return false ;
}
TestNookWnd wnd ;
std::cout << "Creating window, width: " << m_fbw << ", height: " << m_fbh << std::endl ;
if (!wnd.create(0,0,m_fbw, m_fbh)){
std::cerr << "Cannot create window\n";
return false ;
}
register_window(wnd) ;
while(1){
dispatch_app_events() ;
nanosleep(&tenthsec,NULL) ;
}
}
int main()
{
TestNookApp app ;
bool ret = app.run() ;
std::cout << "Application exit: " << ret << std::endl ;
return 0;
}