Added more tft functions to common and emulator. Fixed eventloop.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user