libobs: Add function to get last main output texture

Allows the ability to get the last rendered texture of the main output
view.
This commit is contained in:
jp9000
2018-04-20 05:56:28 -07:00
parent b4d6f1c996
commit 904ad9be1d
2 changed files with 21 additions and 0 deletions

View File

@@ -1468,6 +1468,23 @@ void obs_render_main_texture(void)
gs_draw_sprite(tex, 0, 0, 0);
}
gs_texture_t *obs_get_main_texture(void)
{
struct obs_core_video *video = &obs->video;
int last_tex;
if (!obs) return NULL;
last_tex = video->cur_texture == 0
? NUM_TEXTURES - 1
: video->cur_texture - 1;
if (!video->textures_rendered[last_tex])
return NULL;
return video->render_textures[last_tex];
}
void obs_set_master_volume(float volume)
{
struct calldata data = {0};