Exemple #1
0
static void image_source_render(void *data, effect_t effect)
{
	struct image_source *context = data;
	if (!context->tex)
		return;

	gs_reset_blend_state();
	effect_settexture(effect_getparambyname(effect, "image"), context->tex);
	gs_draw_sprite(context->tex, 0, context->cx, context->cy);
}
Exemple #2
0
static void image_source_render(void *data, gs_effect_t *effect)
{
	struct image_source *context = data;

	if (!context->image.texture)
		return;

	gs_reset_blend_state();
	gs_effect_set_texture(gs_effect_get_param_by_name(effect, "image"),
			context->image.texture);
	gs_draw_sprite(context->image.texture, 0,
			context->image.cx, context->image.cy);
}
static void destiny_detail_render(void *data, gs_effect_t *effect)
{
	gs_reset_blend_state();

	vec4 clear_color;
	vec4_zero(&clear_color);

	clear_color.w = 1.0;
	clear_color.y = 255;

	// This clears the entire view
	gs_clear(GS_CLEAR_COLOR, &clear_color, 0.0f, 0);
}
void BrowserSource::Impl::RenderCurrentTexture(gs_effect_t *effect)
{
	GetParent()->LockTexture();

	if (activeTexture != nullptr) {
		gs_reset_blend_state();
		gs_effect_set_texture(
				gs_effect_get_param_by_name(effect, "image"),
				activeTexture);
		gs_draw_sprite(activeTexture, 0, parent->GetWidth(), 
				parent->GetHeight());
	}
	
	GetParent()->UnlockTexture();
}
void XCompcapMain::render(effect_t effect)
{
	PLock lock(&p->lock, true);

	if (!lock.isLocked() || !p->tex)
		return;

	eparam_t image = effect_getparambyname(effect, "image");
	effect_settexture(image, p->tex);

	gs_enable_blending(false);
	gs_draw_sprite(p->tex, 0, 0, 0);

	gs_reset_blend_state();
}
static void ft2_source_render(void *data, gs_effect_t effect)
{
	struct ft2_source *srcdata = data;
	if (srcdata == NULL) return;

	if (srcdata->tex == NULL || srcdata->vbuf == NULL) return;

	gs_reset_blend_state();
	if (srcdata->outline_text) draw_outlines(srcdata);
	if (srcdata->drop_shadow) draw_drop_shadow(srcdata);

	draw_uv_vbuffer(srcdata->vbuf, srcdata->tex,
		srcdata->draw_effect, (uint32_t)wcslen(srcdata->text) * 6);

	UNUSED_PARAMETER(effect);
}
Exemple #7
0
static void scene_video_render(void *data, gs_effect_t *effect)
{
	DARRAY(struct obs_scene_item*) remove_items;
	struct obs_scene *scene = data;
	struct obs_scene_item *item;

	da_init(remove_items);

	video_lock(scene);
	item = scene->first_item;

	gs_blend_state_push();
	gs_reset_blend_state();

	while (item) {
		if (obs_source_removed(item->source)) {
			struct obs_scene_item *del_item = item;
			item = item->next;

			remove_without_release(del_item);
			da_push_back(remove_items, &del_item);
			continue;
		}

		if (source_size_changed(item))
			update_item_transform(item);

		if (item->user_visible) {
			gs_matrix_push();
			gs_matrix_mul(&item->draw_transform);
			obs_source_video_render(item->source);
			gs_matrix_pop();
		}

		item = item->next;
	}

	gs_blend_state_pop();

	video_unlock(scene);

	for (size_t i = 0; i < remove_items.num; i++)
		obs_sceneitem_release(remove_items.array[i]);
	da_free(remove_items);

	UNUSED_PARAMETER(effect);
}
/**
 * Render the capture data
 */
static void xshm_video_render(void *vptr, gs_effect_t effect)
{
	XSHM_DATA(vptr);

	if (!data->xshm)
		return;

	gs_eparam_t image = gs_effect_get_param_by_name(effect, "image");
	gs_effect_set_texture(image, data->texture);

	gs_enable_blending(false);
	gs_draw_sprite(data->texture, 0, 0, 0);

	if (data->show_cursor)
		xcursor_render(data->cursor);

	gs_reset_blend_state();
}
void XCompcapMain::render(gs_effect_t *effect)
{
	PLock lock(&p->lock, true);

	if (!lock.isLocked() || !p->tex)
		return;

	gs_eparam_t *image = gs_effect_get_param_by_name(effect, "image");
	gs_effect_set_texture(image, p->tex);

	gs_enable_blending(false);
	gs_draw_sprite(p->tex, 0, 0, 0);

	if (p->cursor && p->gltex && p->show_cursor && !p->cursor_outside)
		xcursor_render(p->cursor);

	gs_reset_blend_state();
}