wykobi_window(int argc, char* argv[]) { display_mode = eDisplayMode2D; handle = this; glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); glutInitWindowSize(window_width(),window_height()); glutInitWindowPosition(window_position_x(),window_position_y()); glutInit(&argc,argv); glutCreateWindow(window_title().c_str() ); glutKeyboardFunc(glut_keyboard_handler ); glutSpecialFunc (glut_special_key_handler); glutReshapeFunc (glut_reshape_handler ); glutDisplayFunc (glut_display_handler ); glutMouseFunc (glut_mouse_handler ); glutMotionFunc (glut_motion_handler ); glutCreateMenu (glut_menu_handler ); glutIdleFunc (glut_idle_handler ); if (handle->display_mode == eDisplayMode2D) { glClearColor (0.0, 0.0, 0.0, 0.0); gluOrtho2D (0.0, handle->window_width()-1, handle->window_height()-1,0.0); glDisable(GL_DEPTH_TEST); } }
void TCore::on_timer() { qDebug ()<<__FUNCTION__; label_and_move(); labelF(); labelI_and_hide(); list(); enterF(); window_title(); enterI(); graph(); led(); dial(); lcd_label(); }
int main(int, char**) { HWND previous_foreground_window = nullptr; for (;;) { HWND foreground_window = GetForegroundWindow(); if (foreground_window != nullptr && foreground_window != previous_foreground_window) { //Foreground window changed. std::wstring filename(get_process_filename(foreground_window)); std::wstring window_title(get_window_title(foreground_window)); std::wstring timestamp(get_current_timestamp()); // Format: [HH:MM:SS] name.exe | Window Title wprintf(L"%s %s | %s\n", timestamp.c_str(), filename.c_str(), window_title.c_str()); previous_foreground_window = foreground_window; } Sleep(100); } }
int maoni_main(int argc, char* argv[], RenderAlgorithm* algorithm_stack) { boost::mpi::environment env(argc, argv); QApplication app(argc, argv); Q_INIT_RESOURCE( Resources); QPixmap pixmap(":/Maoni/Splashscreen.jpg"); QSplashScreen splash(pixmap, Qt::WindowStaysOnTopHint); FrameDataIceT framedata(algorithm_stack); RenderWidgetIceT* icet_widget = new RenderWidgetIceT(framedata); QWidget* main_window; if (framedata.master()) { MainWindow* mw = new MainWindow(framedata, icet_widget); TilesWidget* tiles_widget = new TilesWidget(framedata); mw->connect(mw, SIGNAL(data_updated()), tiles_widget, SLOT( update_browser())); mw->add_dock("Tile Config", Qt::LeftDockWidgetArea, // tiles_widget); main_window = mw; splash.show(); } else { main_window = icet_widget; } QString window_title("Maoni using IceT Parallel Rendering; Rank %1"); main_window->setWindowTitle(window_title.arg(framedata.myrank())); QTimer::singleShot(1000, main_window, SLOT(show())); QTimer::singleShot(1337, &splash, SLOT(close())); env.abort(app.exec()); return 0; }
bool CApp::OnInit() { COptions::options.LoadOptions(); if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { return false; } if (!(Surf_WIcon = SDL_LoadBMP(data::FindFile("gfx/ITD++.bmp").c_str()))) { return false; } SDL_WM_SetIcon(Surf_WIcon, NULL); int ScreenWidth = COptions::options.getScreenWidth(); int ScreenHeight = COptions::options.getScreenHeight(); Uint32 flags = SDL_HWSURFACE | SDL_DOUBLEBUF; if (!(Surf_Display = SDL_SetVideoMode(ScreenWidth, ScreenHeight, 32, flags))) { return false; } if (!CText::TextControl.OnLoad()) { return false; } std::string window_title("Into The Dungeon++ "); window_title += VERSION; SDL_WM_SetCaption(window_title.c_str(), window_title.c_str()); if (!COptions::options.getWindowed()) { Surf_Display = SDL_SetVideoMode(ScreenWidth, ScreenHeight, 32, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN); } Surf_LoadScreen = CSurface::OnLoad( data::FindFile("gfx/UI/MENU_BACKGROUND_800x600.png").c_str()); if (!Surf_LoadScreen) { return false; } RenderLoading(); Surf_Background = SDL_CreateRGBSurface(SDL_SWSURFACE, ScreenWidth, ScreenHeight, 32, 0, 0, 0, 0); if (!CArea::area_control.OnLoad()) { return false; } ItemRenderSystem::surf_items = CSurface::OnLoad(data::FindFile("gfx/Items.png").c_str()); if (!ItemRenderSystem::surf_items) { return false; } if (!CHud::HUD.OnLoad()) { return false; } player = LevelLoader::startNewGame(); /*Initialize audio*/ if (Mix_OpenAudio(22050, AUDIO_S16SYS, 2, 4096) < 0) { setSurf_Text("NoSound"); } Music = CMusic::OnLoad(data::FindFile("audio/BGM/ITDInGame.ogg").c_str()); MusicBoss = CMusic::OnLoad(data::FindFile("audio/BGM/ITDBossFight.ogg").c_str()); MusicIntro = CMusic::OnLoad(data::FindFile("audio/BGM/ITDIntro.ogg").c_str()); if (!Music || !MusicBoss || !MusicIntro) { setSurf_Text("Unable to open music"); } if (!CMusic::SoundControl.LoadSounds()) { setSurf_Text("Unable to open sounds"); } CMusic::SoundControl.Play(MusicIntro, -1); Surf_TextOverlay = CSurface::OnLoad(data::FindFile("gfx/UI/Text.png").c_str()); if (!Surf_TextOverlay) { return false; } SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); SDL_EnableUNICODE(SDL_ENABLE); return true; }