/** * Main function to test objects. */ int main (int argc, char *argv[]) { win_factory_handle win_factory_h; osx_factory_handle osx_factory_h; win_factory_h = win_factory_new1(); if (NULL == win_factory_h) { return (1); } osx_factory_h = osx_factory_new1(); if (NULL == osx_factory_h) { return (1); } printf("\n*** Generating Windows GUI ***\n\n"); generate_gui(win_factory_cast_to_gui_factory(win_factory_h)); printf("\n*** Generating OSX GUI ***\n\n"); generate_gui(osx_factory_cast_to_gui_factory(osx_factory_h)); win_factory_delete(win_factory_h); osx_factory_delete(osx_factory_h); printf("\n"); return (0); }
int main(int argc, char *argv[]) { /* Declare conf struct */ SPRY_CONF* conf; /* sets the gtk locale for the current system */ gtk_set_locale(); /* grap gtk-specific arguments and apply accordingly */ gtk_init(&argc, &argv); /* check for g_thread support */ if (!g_thread_supported()) { g_thread_init(NULL); } /* parse command line arguments and return the initial struct */ conf = parse_args(argc, argv); /* Create the GUI (main window) */ conf->gtk_objects = generate_gui(conf); /* apply gui settings */ gui_apply_mode(conf); /* load the web page */ browser_open(conf, (gchar*)conf->init_url); /* Start GTK */ gtk_main(); /* done */ return 0; }
void application::run() { if (!_initialized) return; _should_run = true; auto start_time = hr_clock::now(); while (_should_run) { /* Process OS Events */ process_messages(); _time_running = std::chrono::duration_cast<millis_interval>(hr_clock::now() - start_time); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* Actual rendering */ // TODO(Corralx): Render something /* Generate the GUI */ if (_render_gui) { imgui_new_frame(); generate_gui(); ImGui::Render(); } /* Swap buffers */ SDL_GL_SwapWindow(_window); } }