예제 #1
0
obs_display_t obs_display_create(struct gs_init_data *graphics_data)
{
	struct obs_display *display = bmalloc(sizeof(struct obs_display));
	memset(display, 0, sizeof(struct obs_display));

	if (graphics_data) {
		display->swap = gs_create_swapchain(graphics_data);
		if (!display->swap) {
			obs_display_destroy(display);
			return NULL;
		}
	}

	return display;
}
예제 #2
0
bool obs_display_init(struct obs_display *display,
		struct gs_init_data *graphics_data)
{
	pthread_mutex_init_value(&display->draw_callbacks_mutex);

	if (graphics_data) {
		display->swap = gs_create_swapchain(graphics_data);
		if (!display->swap) {
			blog(LOG_ERROR, "obs_display_init: Failed to "
			                "create swap chain");
			return false;
		}

		display->cx = graphics_data->cx;
		display->cy = graphics_data->cy;
	}

	if (pthread_mutex_init(&display->draw_callbacks_mutex, NULL) != 0) {
		blog(LOG_ERROR, "obs_display_init: Failed to create mutex");
		return false;
	}

	return true;
}