Exemple #1
0
extern "C" void bind_appleseed_python_classes()
{
    boost::python::scope().attr("APPLESEED_VERSION") = APPLESEED_VERSION;
    boost::python::scope().attr("APPLESEED_VERSION_MAJOR") = APPLESEED_VERSION_MAJOR;
    boost::python::scope().attr("APPLESEED_VERSION_MINOR") = APPLESEED_VERSION_MINOR;
    boost::python::scope().attr("APPLESEED_VERSION_PATCH") = APPLESEED_VERSION_PATCH;
    boost::python::scope().attr("APPLESEED_VERSION_MATURITY") = APPLESEED_VERSION_MATURITY;
    boost::python::scope().attr("APPLESEED_VERSION_STRING") = APPLESEED_VERSION_STRING;

    bind_utility();
    bind_murmurhash();
    bind_logger();

    bind_vector();
    bind_basis();
    bind_quaternion();
    bind_bbox();
    bind_matrix();
    bind_transform();

    bind_entity();

    bind_color();
    bind_texture();
    bind_bsdf();
    bind_bssrdf();
    bind_edf();
    bind_shader_group();

    bind_surface_shader();
    bind_material();
    bind_light();
    bind_object();
    bind_mesh_object();
    bind_assembly();

    bind_camera();
    bind_environment();
    bind_scene();

    bind_image();
    bind_aov();
    bind_frame();
    bind_fresnel();
    bind_display();
    bind_project();

    bind_renderer_controller();
    bind_tile_callback();
    bind_master_renderer();
}
Exemple #2
0
static int hotplug(struct uterm_video *video)
{
	drmModeRes *res;
	drmModeConnector *conn;
	struct uterm_display *disp, *tmp;
	int i;

	if (!video_is_awake(video) || !video_need_hotplug(video))
		return 0;

	res = drmModeGetResources(video->dumb.fd);
	if (!res) {
		log_err("cannot retrieve drm resources");
		return -EACCES;
	}

	for (disp = video->displays; disp; disp = disp->next)
		disp->flags &= ~DISPLAY_AVAILABLE;

	for (i = 0; i < res->count_connectors; ++i) {
		conn = drmModeGetConnector(video->dumb.fd, res->connectors[i]);
		if (!conn)
			continue;
		if (conn->connection == DRM_MODE_CONNECTED) {
			for (disp = video->displays; disp; disp = disp->next) {
				if (disp->dumb.conn_id == res->connectors[i]) {
					disp->flags |= DISPLAY_AVAILABLE;
					break;
				}
			}
			if (!disp)
				bind_display(video, res, conn);
		}
		drmModeFreeConnector(conn);
	}

	drmModeFreeResources(res);

	while (video->displays) {
		tmp = video->displays;
		if (tmp->flags & DISPLAY_AVAILABLE)
			break;

		video->displays = tmp->next;
		tmp->next = NULL;
		unbind_display(tmp);
	}
	for (disp = video->displays; disp && disp->next; ) {
		tmp = disp->next;
		if (tmp->flags & DISPLAY_AVAILABLE) {
			disp = tmp;
		} else {
			disp->next = tmp->next;
			tmp->next = NULL;
			unbind_display(tmp);
		}
	}

	video->flags &= ~VIDEO_HOTPLUG;
	return 0;
}