Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ui::GLArea glwidget_new(bool zbuffer)
- {
- auto self = ui::GLArea::from(GTK_GL_AREA(gtk_gl_area_new()));
- gtk_gl_area_set_has_depth_buffer(self, zbuffer);
- gtk_gl_area_set_auto_render(self, true); // FIXME
- if ( g_shared )
- {
- GdkGLContext *context = gtk_gl_area_get_context(GTK_GL_AREA(self));
- GdkGLContext *shared = gtk_gl_area_get_context(GTK_GL_AREA(g_shared));
- // GdkGLContext *sharedshared = gdk_gl_context_get_shared_context(shared);
- GValue gvalue = G_VALUE_INIT;
- g_value_init(&gvalue, G_TYPE_OBJECT);
- g_value_set_object(&gvalue, G_OBJECT(shared));
- g_object_set_property(G_OBJECT(context), "shared-context", &gvalue);
- // g_object_set(G_OBJECT(context), "shared-context", G_OBJECT(shared), NULL);
- }
- self.connect("realize", G_CALLBACK(glwidget_context_created), nullptr);
- }
Add Comment
Please, Sign In to add comment