int main(int argc, char** argv) { GLFWwindow* window; glfwSetErrorCallback(on_error); if (!glfwInit()) exit(EXIT_FAILURE); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); window = glfwCreateWindow(800, 600, "show mesh", NULL, NULL); if (!window) { glfwTerminate(); exit(EXIT_FAILURE); } glfwSetKeyCallback(window, on_key); glfwSetCursorPosCallback(window, on_mouse); glfwSetMouseButtonCallback(window, on_click); glfwSetScrollCallback(window, on_scroll); glfwMakeContextCurrent(window); gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); glfwSwapInterval(1); app_init(argc, argv); gui_init(window); while (!glfwWindowShouldClose(window)) { float ratio; int width, height; glfwGetFramebufferSize(window, &width, &height); ratio = width / (float) height; glViewport(0, 0, width, height); glClear(GL_COLOR_BUFFER_BIT); glfwPollEvents(); app_draw(ratio); gui_logic(); gui_draw(); glfwSwapBuffers(window); } glfwDestroyWindow(window); glfwTerminate(); app_cleanup(); gui_cleanup(); exit(EXIT_SUCCESS); }
static void cleanup (LV2UI_Handle handle) { BITui* ui = (BITui*)handle; ui_disable (handle); gui_cleanup (ui); free (ui); }
/***************************************************************************** * FUNCTION * widget_MMI_on_window_focus_changed * DESCRIPTION * * PARAMETERS * void * RETURNS * void *****************************************************************************/ static void widget_MMI_on_window_focus_changed(void) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ if (WGUI_CTX->is_widget_screen) { #ifdef __MMI_TOUCH_SCREEN__ widget_MMI_reset_pen_on_screen_switch(); #endif HDIa_widgetExtCloseVideo(); gui_cleanup(); widget_disable_multi_layer(); widget_enable_clear_all_handler(); widget_clear_all_handler(); #if defined (WIDGET_RESIDENT_STATUS_ICON) && defined (__MMI_WALLPAPER_ON_BOTTOM__) { /* * Here is very tricky. * The widget handles status icon bars by itself (WAP task controls), * but sometimes MMI task will updates at the same time. (ex. have blinking icons). * It causes the background of the status bar is white color not the wallpaper image. * We will hide status icon when the window changed focus and draw the status bar in widget_paint. */ hide_status_icon_bar(0); } #endif /* WIDGET_RESIDENT_STATUS_ICON && __MMI_WALLPAPER_ON_BOTTOM__ */ #ifdef MMI_SHOW_STATUS_ICON_IN_TITLE wgui_status_icon_integrated_enable(MMI_FALSE); #endif } }
ApplicationManager::~ApplicationManager() { // network if (networkManager_) delete networkManager_; // application application_->deinitialize(); delete application_; // audio gaudio_Cleanup(); // texture gtexture_cleanup(); // ui gui_cleanup(); // http ghttp_Cleanup(); // geolocation ggeolocation_cleanup(); // input ginput_cleanup(); // application gapplication_cleanup(); // event gevent_Cleanup(); // gpath & gvfs gvfs_cleanup(); gpath_cleanup(); }
int main(int argc, char *argv[]){ QCoreApplication::setOrganizationName(Constants::ORGANIZATION_NAME); QCoreApplication::setOrganizationDomain(Constants::ORGANIZATION_DOMAIN); QCoreApplication::setApplicationName(Constants::DESK_APPLICATION_NAME); QApplication a(argc, argv); QDir dir = QCoreApplication::applicationDirPath(); #if defined(Q_OS_MAC) dir.cdUp(); #endif QDir::setCurrent(dir.absolutePath()); gpath_init(); gpath_addDrivePrefix(0, "|R|"); gpath_addDrivePrefix(0, "|r|"); gpath_addDrivePrefix(1, "|D|"); gpath_addDrivePrefix(1, "|d|"); gpath_addDrivePrefix(2, "|T|"); gpath_addDrivePrefix(2, "|t|"); gpath_setDriveFlags(0, GPATH_RO | GPATH_REAL); gpath_setDriveFlags(1, GPATH_RW | GPATH_REAL); gpath_setDriveFlags(2, GPATH_RW | GPATH_REAL); gpath_setAbsolutePathFlags(GPATH_RW | GPATH_REAL); gpath_setDefaultDrive(0); gvfs_init(); gevent_Init(); gapplication_init(); ginput_init(); ggeolocation_init(); ghttp_Init(); gui_init(); gtexture_init(); gaudio_Init(); loadPlugins(); int result = 0; { MainWindow w; w.show(); result = a.exec(); } gaudio_Cleanup(); gtexture_cleanup(); gui_cleanup(); ghttp_Cleanup(); ggeolocation_init(); ginput_cleanup(); gapplication_cleanup(); gevent_Cleanup(); gvfs_cleanup(); gpath_cleanup(); return result; }
/** * @brief Opens the main menu (titlescreen). */ void menu_main (void) { int offset_logo, offset_wdw, freespace; unsigned int bwid, wid; glTexture *tex; int h, y; if (menu_isOpen(MENU_MAIN)) { WARN( _("Menu main is already open.") ); return; } /* Clean up GUI - must be done before using SCREEN_W or SCREEN_H. */ gui_cleanup(); player_soundStop(); /* Stop sound. */ /* Play load music. */ music_choose("load"); /* Load background and friends. */ tex = gl_newImage( GFX_PATH"Naev.png", 0 ); main_naevLogo = tex; menu_main_bkg_system(); /* Set dimensions */ y = 20 + (BUTTON_HEIGHT+20)*5; h = y + 80; if (conf.devmode) { h += BUTTON_HEIGHT + 20; y += BUTTON_HEIGHT + 20; } /* Calculate Logo and window offset. */ freespace = SCREEN_H - tex->sh - h; if (freespace < 0) { /* Not enough freespace, this can get ugly. */ offset_logo = SCREEN_W - tex->sh; offset_wdw = 0; } /* Otherwise space evenly. */ else { offset_logo = -freespace/4; offset_wdw = freespace/2; } /* create background image window */ bwid = window_create( "BG", -1, -1, -1, -1 ); window_onClose( bwid, menu_main_cleanBG ); window_setBorder( bwid, 0 ); window_addImage( bwid, (SCREEN_W-tex->sw)/2., offset_logo, 0, 0, "imgLogo", tex, 0 ); window_addText( bwid, 0, 10, SCREEN_W, 30., 1, "txtBG", NULL, &cWhite, naev_version(1) ); /* create menu window */ wid = window_create( "Main Menu", -1, offset_wdw, MAIN_WIDTH, h ); window_setCancel( wid, main_menu_promptClose ); /* Buttons. */ window_addButtonKey( wid, 20, y, BUTTON_WIDTH, BUTTON_HEIGHT, "btnLoad", _("Load Game"), menu_main_load, SDLK_l ); y -= BUTTON_HEIGHT+20; window_addButtonKey( wid, 20, y, BUTTON_WIDTH, BUTTON_HEIGHT, "btnNew", _("New Game"), menu_main_new, SDLK_n ); y -= BUTTON_HEIGHT+20; window_addButtonKey( wid, 20, y, BUTTON_WIDTH, BUTTON_HEIGHT, "btnTutorial", _("Tutorial"), menu_main_tutorial, SDLK_t ); y -= BUTTON_HEIGHT+20; if (conf.devmode) { window_addButtonKey( wid, 20, y, BUTTON_WIDTH, BUTTON_HEIGHT, "btnEditor", _("Editors"), menu_editors_open, SDLK_e ); y -= BUTTON_HEIGHT+20; } window_addButtonKey( wid, 20, y, BUTTON_WIDTH, BUTTON_HEIGHT, "btnOptions", _("Options"), menu_options_button, SDLK_o ); y -= BUTTON_HEIGHT+20; window_addButtonKey( wid, 20, y, BUTTON_WIDTH, BUTTON_HEIGHT, "btnCredits", _("Credits"), menu_main_credits, SDLK_c ); y -= BUTTON_HEIGHT+20; window_addButtonKey( wid, 20, y, BUTTON_WIDTH, BUTTON_HEIGHT, "btnExit", _("Exit"), menu_exit, SDLK_x ); /* Disable load button if there are no saves. */ if (!save_hasSave()) window_disableButton( wid, "btnLoad" ); /* Make the background window a child of the menu. */ window_setParent( bwid, wid ); unpause_game(); menu_Open(MENU_MAIN); }
void CatheterFrame::OnExit(wxCommandEvent& e) { gui_cleanup(); Close(true); }
int main(int argc, char *argv[]) { // curl_global_init(CURL_GLOBAL_WIN32); QCoreApplication::setOrganizationName("GiderosMobile"); QCoreApplication::setOrganizationDomain("giderosmobile.com"); QCoreApplication::setApplicationName("GiderosPlayer"); QSettings::setDefaultFormat(QSettings::IniFormat); QApplication a(argc, argv); QDir dir = QCoreApplication::applicationDirPath(); #if defined(Q_OS_MAC) dir.cdUp(); #endif QDir::setCurrent(dir.absolutePath()); gpath_init(); gpath_addDrivePrefix(0, "|R|"); gpath_addDrivePrefix(0, "|r|"); gpath_addDrivePrefix(1, "|D|"); gpath_addDrivePrefix(1, "|d|"); gpath_addDrivePrefix(2, "|T|"); gpath_addDrivePrefix(2, "|t|"); gpath_setDriveFlags(0, GPATH_RO | GPATH_REAL); gpath_setDriveFlags(1, GPATH_RW | GPATH_REAL); gpath_setDriveFlags(2, GPATH_RW | GPATH_REAL); gpath_setAbsolutePathFlags(GPATH_RW | GPATH_REAL); gpath_setDefaultDrive(0); gvfs_init(); gevent_Init(); gapplication_init(); ginput_init(); ggeolocation_init(); ghttp_Init(); gui_init(); gtexture_init(); gaudio_Init(); loadPlugins(); /* if (argc > 1) setZipFile(argv[1]); */ int result = 0; { MainWindow w; w.show(); result = a.exec(); } gaudio_Cleanup(); gtexture_cleanup(); gui_cleanup(); ghttp_Cleanup(); ggeolocation_init(); ginput_cleanup(); gapplication_cleanup(); gevent_Cleanup(); gvfs_cleanup(); gpath_cleanup(); // curl_global_cleanup(); return result; }