filter-displacement: Fix warnings

This commit is contained in:
Michael Fabian Dirks 2017-07-03 02:43:33 +02:00
parent 03e2001137
commit 5b189cb73b
2 changed files with 11 additions and 5 deletions

View file

@ -139,10 +139,8 @@ Filter::Displacement::Instance::Instance(obs_data_t *data, obs_source_t *context
Filter::Displacement::Instance::~Instance() {
obs_enter_graphics();
if (customEffect)
gs_effect_destroy(customEffect);
if (dispmap.texture)
gs_texture_destroy(dispmap.texture);
gs_effect_destroy(customEffect);
gs_texture_destroy(dispmap.texture);
obs_leave_graphics();
}
@ -191,7 +189,8 @@ void Filter::Displacement::Instance::video_render(gs_effect_t *) {
baseH = obs_source_get_base_height(target);
// Skip rendering if our target, parent or context is not valid.
if (!target || !parent || !context || !dispmap.texture) {
if (!target || !parent || !context || !dispmap.texture
|| !baseW || !baseH) {
obs_source_skip_video_filter(context);
return;
}

View file

@ -19,8 +19,15 @@
#pragma once
#include "plugin.h"
extern "C" {
#pragma warning (push)
#pragma warning (disable: 4201)
#include <libobs/obs-source.h>
#include <libobs/util/platform.h>
#pragma warning (pop)
}
#include <string>
#define P_FILTER_DISPLACEMENT "Filter.Displacement"