Can someone tell me, how to load the background of a GtkGLArea on a Cairo surface? For the gtk version 4.8.3, I did it this way–
GtkWidget *GLArea = gtk_gl_area_new ();
/* draw shape on GLArea */
GtkStyleContext *glContext = gtk_widget_get_style_context (GTK_WIDGET(GLArea));
cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, height, height);
cairo_t *cr = cairo_create (surface);
gtk_render_background(glContext, cr, 0 ,0, height, height);
But functiongtk_widget_get_style_context
and gtk_render_background
is deprecated since 4.10. In gtk 4.12, how to do it?