illwieckz

does not work

Mar 22nd, 2021 (edited)
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. ui::GLArea glwidget_new(bool zbuffer)
  2. {
  3.     auto self = ui::GLArea::from(GTK_GL_AREA(gtk_gl_area_new()));
  4.     gtk_gl_area_set_has_depth_buffer(self, zbuffer);
  5.     gtk_gl_area_set_auto_render(self, true); // FIXME
  6.  
  7.     if ( g_shared )
  8.     {
  9.         GdkGLContext *context = gtk_gl_area_get_context(GTK_GL_AREA(self));
  10.  
  11.         GdkGLContext *shared = gtk_gl_area_get_context(GTK_GL_AREA(g_shared));
  12. //      GdkGLContext *sharedshared = gdk_gl_context_get_shared_context(shared);
  13.  
  14.         GValue gvalue = G_VALUE_INIT;
  15.         g_value_init(&gvalue, G_TYPE_OBJECT);
  16.         g_value_set_object(&gvalue, G_OBJECT(shared));
  17.  
  18.         g_object_set_property(G_OBJECT(context), "shared-context", &gvalue);
  19. //      g_object_set(G_OBJECT(context), "shared-context", G_OBJECT(shared), NULL);
  20.     }
  21.  
  22.     self.connect("realize", G_CALLBACK(glwidget_context_created), nullptr);
  23. }
Add Comment
Please, Sign In to add comment