Example #1
0
int		main(int ac, char *av)
{
  SDL_Window	*window;
  SDL_Renderer	*renderer;

  create_win_context(&window, "DAT PoONG", 640, 480);
  create_renderer(&renderer, &window);
  if (load_splash(renderer, "pong.png") == 1)
    {
      SDL_DestroyRenderer(renderer);
      renderer = SDL_CreateRenderer(window, 0, SDL_RENDERER_ACCELERATED);
      wait_event(renderer);
    }
  //wait_event(renderer);
  destroy_SDL(renderer, &window);
  pong_calc(ac, av);
  return (0); 
}
Example #2
0
static void init_ui( squidge_t *sq )
{
	GtkBuilder *builder;
	PangoFontDescription *pf;
	GtkAdjustment *v;

	builder = gtk_builder_new();
	g_assert( gtk_builder_add_from_string( builder, squidge_gtkbuilder, -1, NULL ) );

	obj( GTK_WINDOW, win );
	obj( GTK_NOTEBOOK, notebook );
	obj( GTK_IMAGE, splash );
	obj( GTK_TEXT_VIEW, log_textview );
	obj( GTK_SCROLLED_WINDOW, log_scroll );

	sq->ui.text_buffer = gtk_text_view_get_buffer(sq->ui.log_textview);
	load_splash(sq);
	camview_init( &sq->camview, builder );

	/* We want a monospace font */
	pf = pango_font_description_from_string("Monospace 10");
	g_assert( pf != NULL );
	gtk_widget_modify_font( GTK_WIDGET(sq->ui.log_textview), pf );
	pango_font_description_free( pf );

	/* We want the value-changed signal so we can stop following the bottom */
	v = gtk_scrolled_window_get_vadjustment( sq->ui.log_scroll );
	g_signal_connect( v, "value-changed",
			  G_CALLBACK(vert_value_changed), sq );
	g_signal_connect( v, "changed",
			  G_CALLBACK(vert_changed), sq );

	gtk_builder_connect_signals( builder, sq );
	g_object_unref( G_OBJECT(builder) );
	gtk_widget_show( GTK_WIDGET(sq->ui.win) );
}