Esempio n. 1
0
static void
_vte_gl_set_text_font(struct _vte_draw *draw,
		     const PangoFontDescription *fontdesc,
		     VteTerminalAntiAlias antialias)
{
	struct _vte_gl_data *data = draw->impl_data;

	if (data->cache != NULL) {
		_vte_glyph_cache_free(data->cache);
		data->cache = NULL;
	}
	data->cache = _vte_glyph_cache_new();

	_vte_glyph_cache_set_font_description(draw->widget,
					      NULL, data->cache, fontdesc,
					      antialias,
					      _vte_gl_fcpattern_disable_rgba,
					      NULL);
}
Esempio n. 2
0
File: vtegl.c Progetto: Cordia/vte
static void
_vte_gl_create(struct _vte_draw *draw, GtkWidget *widget)
{
	struct _vte_gl_data *data;
	int attributes[] = {_vte_gl_attributes};
	GdkDisplay *gdisplay;
	Display *display;
	GdkScreen *gscreen;
	int screen;

	draw->impl_data = g_slice_new(struct _vte_gl_data);
	data = (struct _vte_gl_data*) draw->impl_data;

	gdisplay = gtk_widget_get_display (widget);
	display = gdk_x11_display_get_xdisplay (gdisplay);
	gscreen = gtk_widget_get_screen (widget);
	screen = gdk_x11_screen_get_screen_number (gscreen);

	data->display = display;

	data->visual_info = glXChooseVisual(display, screen, attributes);
	if (data->visual_info == NULL) {
		g_error("Unable to find a suitable GLX visual.\n");
	}

	data->context = glXCreateContext(display, data->visual_info,
					 NULL, GL_TRUE);
	if (data->context == NULL) {
		g_error("Unable to create a GLX context.\n");
	}

	data->color.red = 0;
	data->color.green = 0;
	data->color.blue = 0;
	data->bgpixbuf = NULL;
	data->glwindow = -1;
	data->scrollx = data->scrolly = 0;
	data->cache = _vte_glyph_cache_new();
	data->buffer = _vte_buffer_new();

	gtk_widget_set_double_buffered(widget, FALSE);
	draw->requires_clear = TRUE;
}