Added more tft functions to common and emulator. Fixed eventloop.

This commit is contained in:
t-moe
2015-04-03 17:45:57 +02:00
parent 51089aaba1
commit 1f2af9f2fb
14 changed files with 194 additions and 39 deletions

View File

@@ -3,29 +3,29 @@
extern "C" {
void qt_init(int argc, char* argv[]);
int qt_execute();
void app_init();
void app_process();
void qt_init(int argc, char* argv[]); //Will be called at the top of the main() function
int qt_execute(); //Will be called after calling qt_execute
void app_init(); //Initializes the app
void app_process(); //Processes one eventloop of the app
}
QApplication* app_ptr;
QApplication* app_ptr=NULL;
void qt_init(int argc, char* argv[]) {
static QApplication app(argc,argv);
app_ptr = &app;
app_ptr = new QApplication(argc,argv);
app_init();
}
void app_loop() {
while(1) {
while(QApplication::activeWindow()!=NULL) {
app_process();
QApplication::processEvents();
}
}
int qt_execute() {
QtConcurrent::run(&app_loop);
return app_ptr->exec();
int ret= app_ptr->exec();
delete app_ptr;
return ret;
}