Пример #1
0
void init (void) {
  width = height = 550;
  init_model();
  init_menu ();  
  glEnable (GL_LINE_SMOOTH);

}
Пример #2
0
Gtk::Window *Control::init(Glib::RefPtr<Gtk::Builder> builder) {
    Gtk::Window *window;
    Gtk::Paned *pane;

    builder->get_widget("main_window", window);
    builder->get_widget("main_pane", pane);

    init_find_all(builder);
    init_spin_buttons(builder);
    init_scales(builder);
    init_menu(builder);

    pane->add2(_drawArea);

    window->add_events(Gdk::KEY_PRESS_MASK);
    window->signal_key_release_event().connect(sigc::mem_fun(this, &Control::on_shortcut));

    Gtk::Label *label;
    builder->get_widget("scale_warning_label", label);
    _drawArea.set_scale_warning_label(label);

    window->set_size_request(1920, 1080);

    return window;
}
Пример #3
0
void init_drivers(void)
{
   driver.video_data_own = false;
   driver.audio_data_own = false;
   driver.input_data_own = false;
#ifdef HAVE_CAMERA
   driver.camera_data_own = false;
#endif
#ifdef HAVE_LOCATION
   driver.location_data_own = false;
#endif
#ifdef HAVE_OSK
   driver.osk_data_own = false;
#endif
#ifdef HAVE_MENU
   // By default, we want the menu to persist through driver reinits.
   driver.menu_data_own = true;
#endif

   adjust_system_rates();

   g_extern.frame_count = 0;

   init_video_input();

   if (!driver.video_cache_context_ack && g_extern.system.hw_render_callback.context_reset)
      g_extern.system.hw_render_callback.context_reset();
   driver.video_cache_context_ack = false;

   init_audio();

#ifdef HAVE_CAMERA
   // Only initialize camera driver if we're ever going to use it.
   if (g_extern.camera_active)
      init_camera();
#endif

#ifdef HAVE_LOCATION
   // Only initialize location driver if we're ever going to use it.
   if (g_extern.location_active)
      init_location();
#endif

#ifdef HAVE_OSK
   init_osk();
#endif

#ifdef HAVE_MENU
   init_menu();

   if (driver.menu && driver.menu_ctx && driver.menu_ctx->context_reset)
      driver.menu_ctx->context_reset(driver.menu);
#endif

   // Keep non-throttled state as good as possible.
   if (driver.nonblock_state)
      driver_set_nonblock_state(driver.nonblock_state);

   g_extern.system.frame_time_last = 0;
}
Пример #4
0
// main
int main(int argc, char *argv[]) {
	glutInit(&argc, argv);
	glutInitWindowSize(800, 800);
	glutInitWindowPosition(300, 300);
	glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
	glutCreateWindow("Cottages");
	
	init_menu();
	init_objects();
	init_lights();
	
	glutReshapeFunc(reshape);
	glutDisplayFunc(draw);
	glutIdleFunc(idle);
	glutSpecialFunc(pressSpecialKeys);
	glutSpecialUpFunc(releaseSpecialKeys);
	glutKeyboardUpFunc(releaseKeys);
	glutMotionFunc(motion);
	glutMouseFunc(mouse);
	glutMainLoop();

	delete cottage;
	delete diamond;
	delete lamp;
	delete ground;
	return 0;
	
}
Пример #5
0
void	check_env_map7(t_data *data)
{
  if (data->map.end == 1)
    {
      init_main(data);
      init_text(data);
      init_map(data);
      init_inventory(data);
      bunny_delete_sound(&data->menu.menu_music->sound);
      init_menu(data);
      data->menu.menu_value = 1;
    }
  if ((data->mouse->x >= 13 && data->mouse->x <=  249) &&
      (data->mouse->y >= 182 && data->mouse->y <= 367))
    {
      if (data->player_pos != 0)
	position_handle(182, 330, data);
      else
	{
	  load_map6(data);
	}
    }
  else
    check_env_map7_2(data);
}
Пример #6
0
Файл: game.c Проект: phoboz/yz
int load_game(void)
{
  srand(time(0));
  init_menu();

  return 1;
}
Пример #7
0
/*
  If enabled in menuconfig, this function is called during boot up of ethersex
*/
int16_t rainmaster_init(void) {
  RAINMASTERDEBUG ("init\n");

  // Handler für Taster initialisieren und gemäß Menu zuweisen
  hook_buttons_input_register(default_button_handler);
  
  // LCD Menu initialisieren und Startbildschirm anzeigen
  init_menu();
  
  // Sensoren initialisieren
  //init_sensors();
  
  // Parameter aus dem EEPROM wiederherstellen
  eeprom_restore(rainmaster_params, &rainmaster_params_ram, sizeof(rainmaster_params_t));

  // Init all standard pumping cycles
  //aqualoop_pumps_cycle_init();

  // Init chemical cleaning cycle
  //aqualoop_cleaning_cycle_init();

  // Init MONITOR networking
  //init_networking();



  return ECMD_FINAL_OK;
}
Пример #8
0
int main() {

	AList_WS* list = new_list();
	init_menu(list);

	return 0;
}
Пример #9
0
int main(void)
{

	char menu[ROW][COL]={"Enter Data","Linear Search","Binary Search","Find Biggest",
			 "Find Smallest","Find 2nd Biggest","Find 2nd Smallest","Selection Sort","bubble_sort",
			 "insertion_sort","Free Data","Exit"};
	char ch;
	int choice,flag;


	flag=0;
	choice=0;
	init_menu();

	do
	{
		draw_menu(20,8,choice,menu);
		ch=getch();
		choice=check_hotkeys(ch);
		flag=menu_body(ch,choice);

	}while(flag!=1);

	return(0);

}
Пример #10
0
static void init(void) {
	load_data();

	init_menu();
	init_main();
	init_info();

	window_stack_push(window_menu, true);
}
Пример #11
0
SpawnPointListMenu::SpawnPointListMenu(SpawnPointList* spawnPointList,
				       QWidget* parent, const char* name)
  : QPopupMenu(parent, name),
    m_spawnPointList(spawnPointList),
    m_currentItem(NULL)
{
  m_id_rename = insertItem("&Rename Spawn Point...",
			   this, SLOT(rename_item(int)));
  m_id_delete = insertItem("&Delete Spawn Point...",
			   this, SLOT(delete_item(int)));
  insertItem("&Clear Spawn Points...",
	     m_spawnPointList, SLOT(clearItems(void)));

  QPopupMenu* listColMenu = new QPopupMenu;
  insertItem("Show &Column", listColMenu);
  listColMenu->setCheckable(true);

  int x = tSpawnPointCoord1;
  m_id_cols[x] = listColMenu->insertItem("Coord &1");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("Coord &2");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("Coord &3");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Remaining");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Name");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Last");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Spawned");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Count");
  listColMenu->setItemParameter(m_id_cols[x], x);
  
  connect (listColMenu, SIGNAL(activated(int)), 
	   this, SLOT(toggle_col(int)));
  
  insertSeparator(-1);
  insertItem("&Font...", this, SLOT(set_font(int)));
  insertItem("&Caption...", this, SLOT(set_caption(int)));

  insertSeparator(-1);
  x = insertItem("Keep Sorted", this, SLOT(toggle_keepSorted(int)));
  setItemChecked(x, m_spawnPointList->keepSorted());

  connect(this, SIGNAL(aboutToShow()),
	  this, SLOT(init_menu()));
}
Пример #12
0
/**
 * manages the running of the program, initialises data structures, loads
 * data and handles the processing of options. The bulk of this function
 * should simply be calling other functions to get the job done.
 **/
int main(int argc, char **argv)
{
    /* validate command line arguments */
	if(argc != ARGSNUMS)
	{
		fprintf(stderr,"Error : Invalid command line args!");
		 fprintf(stderr, "Usage: %s <s> <coinsfile>\n", argv[0]);
		return EXIT_FAILURE;
	}
	
	/* represents the data structures to manage the system */
	BOOLEAN quit= FALSE;
	struct menu_item menu[NUM_OF_OPTS];
    struct ppd_system system;
	int menu_choice;
	
	
    /* init the system */
	system_init(&system);

    /* load data */
	load_data(&system, argv[1],argv[2]);
	
	/* test if everything has been initialised correctly */

	if(!system_init(&system) || !load_data(&system, argv[1],argv[2]))
	{
		fprintf(stderr,"ERROR, QUTING PROGRAM NOW...");
		return EXIT_FAILURE;
	}

	
    /* initialise the menu system */
	
	init_menu(menu);
	
	/* loop, asking for options from the menu */
	do{
		display_menu(menu);
		
		get_integer(&menu_choice,LEN_USER_INPUT, MIN_OPT,MAX_OPT);
		
		menu[menu_choice-1].function(&system);
		
		if(menu_choice==3 || menu_choice== 9)
		{
			quit=TRUE;
		}
		
	}while(!quit);
	
	system_free(&system);
	
    return EXIT_SUCCESS;
}
Пример #13
0
static void
layout_change (void)
{
    setup_panels ();
    layout_do_change = 0;
    /* re-init the menu, because perhaps there was a change in the way 
       how the panel are split (horizontal/vertical). */
    done_menu ();
    init_menu ();
    menubar_arrange (the_menubar);
}
int main(int argc, char**argv)
{
	glutInit( &argc,argv);
	glutInitDisplayMode(GLUT_RGB|GLUT_DEPTH|GLUT_DOUBLE);
	glutInitWindowSize(WINDOW_SIZE_X,WINDOW_POSITION_Y);
	glutInitWindowPosition(WINDOW_POSITION_X,WINDOW_POSITION_Y);
	GLUI_Master.set_glutIdleFunc(NULL);
	init_menu();
	glutMainLoop();
	return 1;
}
Пример #15
0
/**
 * manages the running of the program, initialises data structures, loads
 * data and handles the processing of options. The bulk of this function
 * should simply be calling other functions to get the job done.
 **/
int main(int argc, char **argv)
{

    /* validate command line arguments */
    if(argc != 3) {
		printf("%s\n", "Oops! Your command line arguments are incorrect.");
        return EXIT_FAILURE;
	}

	if(strcmp(argv[1], "stock.dat") != 0 && strcmp(argv[2], "coins.dat") != 0) {
		printf("Oops! Please check your command line arguments: eg ./ppd *items*.dat *funds*.dat \n");
		return EXIT_FAILURE;
	}

    /* represents the data structures to manage the system */
    struct ppd_system system;
    int selection = 0;
    BOOLEAN running = TRUE;

    /* init the system */
    system.stock_file_name = argv[1];
    system.coin_file_name = argv[2];
    system_init(&system);
    printf("System initialised. Please wait.");

    /* load data from .dat files */
    load_data(&system, system.coin_file_name, system.stock_file_name);

    /* initialise the menu system */
    menu_item menu[MENU_SIZE];
    init_menu(menu);

    while (running) {
        /* loop, asking for options from the menu */
        selection = display_menu(menu);
        printf("%s%d%s", "Option ", selection, " has been selected.");

        /* run each option selected */
        if(menu[(selection - 1)].function( &system ) == FALSE) {
            printf("\n\n%s\n", "Sorry! Something went wrong. Now exiting.");
            running = FALSE;
        }

    }

    /* User has opted to quit */

    /* make sure you always free all memory and close all files
     * before you exit the program
     */
    return EXIT_SUCCESS;
}
Пример #16
0
//-----------------------------------------------------------------------------
// start_event_loop
//	This method returns only after a csevBroadcast even has been posted to
//	the Crystal Space event queue with command code csevQuit.
//-----------------------------------------------------------------------------
void OSXAssistant::start_event_loop()
{
  // Fetch the minimal elapsed ticks per second.
  csConfigAccess cfgacc (registry, "/config/system.cfg");
  min_elapsed = (csTicks) cfgacc->GetInt (
    "System.MinimumElapsedTicks", 0);

  csConfigAccess macosx_config(registry, "/config/macosx.cfg", true,
    iConfigManager::PriorityMin);
  init_menu(macosx_config);
  init_runmode();
  OSXDelegate_start_event_loop(controller);
}
Пример #17
0
static void print_menu()
{   
    int array_size = 0;

    menu_size = &array_size;
    m_item = init_menu(menu_size);
    print_frame();
    add_menu_label();
    print_menu_items();
    add_designer_label();
    main_loop();
    endwin();
    attroff(COLOR_PAIR(1));
}
Пример #18
0
/*Quand on appuis echap lors d'une partie*/
int game_menu()
{
	int nb = 3;
	Menu menu;
	init_menu(&menu, nb);
	strcpy(menu.title, "PAUSE");
	strcpy(menu.options[0], "CONTINUER");
	strcpy(menu.options[1], "SAUVER");
	strcpy(menu.options[2], "MENU PRINCIPAL");
	if(!SAVE_ENABLE) menu.available[1]=0;
	int selection = draw_menu(menu);
	delete_menu(&menu);
	return selection;
}
Пример #19
0
/*Le menu de séléction de fichier*/
int select_file_menu()
{
	int nb = NB_LEVEL, i;
	Menu menu;
	init_menu(&menu, nb+1);
	menu.font_size=25;
	menu.space=30;
	strcpy(menu.title, "Choississez un niveau");
	for(i=0; i<nb; i++) sprintf(menu.options[i], "%s", LEVEL_FILE[i]);
	strcpy(menu.options[i], "Annuler");
	int selection = draw_menu(menu);
	delete_menu(&menu);
	return selection;
}
Пример #20
0
static void main_window_load(Window *window) {
    //load main menu
    Layer* window_layer = window_get_root_layer(window);
    s_selected_text = text_layer_create(GRect(0, 90, 144, 40));
    text_layer_set_text(s_selected_text, "Selection goes here");
    
    init_menu();
    s_main_menu_layer = simple_menu_layer_create(GRect(0, 0, 144, 168), window, &s_menu_list, 2, NULL);
    if (s_main_menu_layer == NULL) {
        APP_LOG(APP_LOG_LEVEL_ERROR, "Could not create simple menu!");
    } else {
        layer_add_child(window_layer, simple_menu_layer_get_layer(s_main_menu_layer));
        layer_add_child(window_layer, text_layer_get_layer(s_selected_text));
    }
    
    init_message_handling();
}
Пример #21
0
/*Loersque l'on appuie echap dans l'editeur*/
int edit_menu()
{
	int nb=6;
	Menu menu;
	init_menu(&menu, nb);
	strcpy(menu.title, "MENU EDITEUR");
	strcpy(menu.options[0], "CONTINUER");
	strcpy(menu.options[1], "SAUVER");
	strcpy(menu.options[2], "CHARGER");
	strcpy(menu.options[3], "EFFACER");
	strcpy(menu.options[4], "TESTER");
	strcpy(menu.options[5], "QUITTER");
	menu.available[4]=0;
	int selection = draw_menu(menu);
	delete_menu(&menu);
	return selection;
}
void gamePluginEntry()
{
	u32 ret, key;
	u32 i = 0;
	INIT_SHARED_FUNC(plgGetIoBase, 8);
	INIT_SHARED_FUNC(copyRemoteMemory, 9);
	svc_sleepThread(5000000000);
	
	mode = 0;
	if (((NS_CONFIG*)(NS_CONFIGURE_ADDR))->sharedFunc[8])
	{
		isNewNtr = 1;
	} 
	else
	{
		isNewNtr = 0;
	}
	
	if (isNewNtr)
	{
		IoBasePad = plgGetIoBase(IO_BASE_PAD);
	}
	rtReleaseLock(&((NS_CONFIG*)(NS_CONFIGURE_ADDR))->debugBufferLock);
	plgGetSharedServiceHandle("fs:USER", &fsUserHandle);
	updateMenu();
	current_menu = BASE;
	init_menu();
	create_base_menu();
	show_menu(BASE);
	while (1)
	{
		key = getKey();
		if (key == BUTTON_ST + BUTTON_SE)
		{
			show_menu(BASE);
			waitKeyUp();
		}
		key_trigger(key);
		svc_sleepThread(10000000);
		scanCheatMenu();
		do_all_action();		
	}
}
Пример #23
0
/*Menu principal du jeu*/
int main_menu()
{
	int nb=9;
	Menu menu;
	init_menu(&menu, nb);
	strcpy(menu.title, "BIENVENUE DANS PACMAN!!");
	strcpy(menu.options[0], "CAMPAGNE");
	strcpy(menu.options[1], "EDIT CAMPAGNE");
	strcpy(menu.options[2], "PARTIE UNIQUE");
	strcpy(menu.options[3], "SURVIVOR");
	strcpy(menu.options[4], "CHARGER");
	strcpy(menu.options[5], "EDITER");
	strcpy(menu.options[6], "OPTIONS");
	strcpy(menu.options[7], "HIGH SCORE");
	strcpy(menu.options[8], "QUITTER");
	if(!has_saved_game()) menu.available[4]=0;
	int selection = draw_menu(menu);
	delete_menu(&menu);
	return selection;
}
int		main(int argc, char **argv)
{
  t_gmine	gmine;

  gl_gmine = &gmine;
  init_gtk(argc, argv, &gmine);
  init_main(&gmine);
  init_table(&gmine);
  if ((gmine.buttons = malloc(gmine.x * gmine.y * sizeof(t_button))) == NULL)
    exit(1);
  init_pixmap(&gmine);
  init_menu(&gmine);
  init_buttons(&gmine);
  init_mines(&gmine);
  init_text(&gmine);
  gtk_timeout_add(1000, (GtkFunction) m_timer, &gmine);
  gtk_widget_show_all(gmine.window);
  gtk_main();
  return (0);
}
Пример #25
0
t_pulldown *init_pd(t_x11 *x11, Window Parent, int width,
                    unsigned long fg, unsigned long bg,
                    int nmenu, int *nsub, t_mentry *ent[], const char **title)
{
    t_pulldown *pd;
    int         i;

    snew(pd, 1);
    pd->title = title;
    pd->nmenu = nmenu;
    pd->nsel  = -1;
    snew(pd->m, nmenu);
    snew(pd->xpos, nmenu+1);
    pd->xpos[0] = 5;
    for (i = 1; (i <= nmenu); i++)
    {
        pd->xpos[i] = 20+pd->xpos[i-1]+
            XTextWidth(x11->font, title[i-1], std::strlen(title[i-1]));
    }
    if (pd->xpos[nmenu] > width)
    {
        std::printf("Menu too wide\n");
    }

    InitWin(&(pd->wd), 0, 0, width, XTextHeight(x11->font)+2, 0, "PullDown");
    pd->wd.self = XCreateSimpleWindow(x11->disp, Parent,
                                      pd->wd.x, pd->wd.y,
                                      pd->wd.width, pd->wd.height,
                                      pd->wd.bwidth, fg, bg);
    x11->RegisterCallback(x11, pd->wd.self, Parent, PDCallBack, pd);
    x11->SetInputMask(x11, pd->wd.self, ExposureMask | ButtonPressMask |
                      OwnerGrabButtonMask | ButtonReleaseMask);
    XMapWindow(x11->disp, pd->wd.self);

    for (i = 0; (i < nmenu); i++)
    {
        pd->m[i] = init_menu(x11, Parent, fg, bg, nsub[i], ent[i], 1);
    }

    return pd;
}
Пример #26
0
int main(void) {

	init_menu();
	
	clear();
	init_motor();
	init_timers();
	encoders_init(IO_D2, IO_D3, IO_C4, IO_C5);

	sei();
	while (1) 
	{
		if(g_pd_release) {
			pd_task();
			g_pd_release = 0;
		}

		if(g_velocity_release) {
			velocity_task();
			g_velocity_release = 0;
		}

		if(g_encoder_release) {
			encoder_task();
			g_encoder_release = 0;
		}

		if(g_log_release) {
			log_task();
			g_log_release = 0;
		}

		if(g_interpolate_release) {
			interoplate_task();
			g_interpolate_release = 0;
		}

		serial_check();
		check_for_new_bytes_received();		
	}
}
Пример #27
0
int save_menu(int level)
{
	int nb=3;
	Menu menu;
	init_menu(&menu, nb);
	strcpy(menu.title, "SAVE MENU");
	if(level>=0)
	{
		strcpy(menu.options[0], LEVEL_FILE[level]);
	}
	else
	{
		strcpy(menu.options[0], " ");
		menu.available[0]=0;
	}
	strcpy(menu.options[1], "NEW FILE");
	strcpy(menu.options[2], "ANNULER");
	int selection = draw_menu(menu);
	delete_menu(&menu);
	return selection;
}
Пример #28
0
void switch_to_state(State new_state, Game_Data *data)
{
	switch (new_state)
	{
		case GAME:
		init_game(data);
		break;
		case TITLE:
		init_title(data);
		break;
		case MENU:
		init_menu(data);
		break;
		case GAME_OVER:
		init_game_over(data);
		break;
		case OUT_OF_MEMORY:
		init_oom(data);
		break;
	}
	current_state = new_state;
}
Пример #29
0
char		*main_menu(t_term *term)
{
  char		buf[3];
  t_menu	*menu;
  int		nb_read;
  int		xmenu;
  int		nb_key;
  char		*str;

  xmenu = 0;
  menu = xmalloc(sizeof(*menu) * 4);
  xtputs(xtgetstr("vi", &term->area), 1, my_outc);
  xtputs(term->clstr, 1, my_outc);
  init_menu(menu);
  while (1)
    {
      show_menu(menu, xmenu, 9, term);
      empty_buf(buf, 3);
      nb_read = xread(0, buf, 3);
      if (nb_read == 1 && (buf[0] == 27))
	break;
      else if ((nb_read == 3) && (nb_key = test_key(term, buf[2])))
	xmenu = move_mkey(nb_key, xmenu);
      else if ((nb_read == 1) && (buf[0] == 32))
	{
	  if ((str = main_smenu(term, xmenu, menu)))
	    {
	      xtputs(xtgetstr("ve", &term->area), 1, my_outc);
	      free_menu(menu);
	      return (str);
	    }
	}
    }
  xtputs(xtgetstr("ve", &term->area), 1, my_outc);
  free_menu(menu);
  return (0);
}
Пример #30
0
}

int main(int argc, char **argv)
{
	init_sph_system();

	glutInit(&argc, argv);

	glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
	glutInitWindowSize(window_width, window_height);
	glutCreateWindow("SPH System 2D");

	init();
	init_menu();

    glutDisplayFunc(display_func);
	glutReshapeFunc(reshape_func);
	glutIdleFunc(idle_func);
	glutKeyboardFunc(process_keyboard);
	glutSpecialFunc(special_keys);
	glutMouseFunc(mouse_func);
    glutMotionFunc(motion_func);
    glutMainLoop();