struct pen_source *context = bzalloc(sizeof(struct pen_source));
context->source = source;
if (context->tex)
gs_texture_destroy(context->tex);
struct obs_video_info ovi;
obs_get_video_info(&ovi);
context->width = (int)ovi.base_width;
context->height = (int)ovi.base_height;
size_t len = sizeof(char) * context->width * context->height * 4;
context->data = bzalloc(len);
memset(context->data, 0xff, len);
obs_enter_graphics();
context->tex = gs_texture_create(context->width, context->height, GS_RGBA, 1,
&context->data, GS_DYNAMIC);
obs_leave_graphics();
.......
obs_enter_graphics();
gs_effect_set_texture(gs_effect_get_param_by_name(effect, "image"), context->tex);
gs_draw_sprite(context->tex, 0, context->width, context->height);
obs_leave_graphics();