BOOL hively_init( void ) { const SDL_VideoInfo *info = NULL; gui_pre_init(); about_pre_init(); // Go SDL! if( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER ) < 0 ) { printf( "SDL init failed" ); return FALSE; } atexit(SDL_Quit); if( (info = SDL_GetVideoInfo()) ) srfdepth = info->vfmt->BitsPerPixel; SDL_WM_SetIcon( SDL_LoadBMP( "winicon.bmp" ), NULL ); SDL_EnableUNICODE(SDL_FALSE); // Try to setup the video display #if defined(WIN32) || defined(__APPLE__) || defined(__linux__) // requesters cause all kinds of problems for fullscreen on windows and OSX, so ignore it ssrf = SDL_SetVideoMode( 800, 600, srfdepth, SRFTYPE ); #else ssrf = SDL_SetVideoMode( 800, 600, srfdepth, pref_fullscr ? SDL_FULLSCREEN : SRFTYPE ); #endif if( !ssrf ) { printf( "SDL video failed\n" ); return FALSE; } SDL_WM_SetCaption( "HivelyTracker 1.8", "HivelyTracker 1.8" ); SDL_EnableKeyRepeat(500, 30); if (TTF_Init() == -1) { printf( "SDL TTF failed\n" ); return FALSE; } atexit(TTF_Quit); if( !rp_init() ) return FALSE; if( !gui_init() ) return FALSE; if( !about_init() ) return FALSE; return TRUE; }
int main(int argc, char **argv){ IupOpen(&argc, &argv); led_load(); //Loads the GUI compiled from LED files. mainDlg = IupGetHandle("mainDlg"); //Get the window named "mainDlg" IupShowXY(mainDlg, IUP_CENTER, IUP_CENTER); //Shows the main window aboutDlg = about_init(); //Get the window named "aboutDlg" IupSetCallback(IupGetHandle("about"), "ACTION", (Icallback)main_about); //Callback: Associates the click action of the button "about" with the "about" function. IupMainLoop(); IupClose(); return EXIT_SUCCESS; }