mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-14 07:45:06 +00:00
filter-shape: Use new GS classes
This commit is contained in:
parent
e619f03217
commit
fce3fb8977
2 changed files with 5 additions and 5 deletions
|
@ -245,7 +245,7 @@ void Filter::Shape::video_render(void *ptr, gs_effect_t *effect) {
|
||||||
Filter::Shape::Instance::Instance(obs_data_t *data, obs_source_t *context)
|
Filter::Shape::Instance::Instance(obs_data_t *data, obs_source_t *context)
|
||||||
: context(context) {
|
: context(context) {
|
||||||
obs_enter_graphics();
|
obs_enter_graphics();
|
||||||
m_vertexHelper = new Helper::VertexBuffer(maximumPoints);
|
m_vertexHelper = new GS::VertexBuffer(maximumPoints);
|
||||||
m_vertexHelper->set_uv_layers(1);
|
m_vertexHelper->set_uv_layers(1);
|
||||||
m_texRender = gs_texrender_create(GS_RGBA, GS_Z32F);
|
m_texRender = gs_texrender_create(GS_RGBA, GS_Z32F);
|
||||||
obs_leave_graphics();
|
obs_leave_graphics();
|
||||||
|
@ -263,7 +263,7 @@ void Filter::Shape::Instance::update(obs_data_t *data) {
|
||||||
uint32_t points = (uint32_t)obs_data_get_int(data, P_SHAPE_POINTS);
|
uint32_t points = (uint32_t)obs_data_get_int(data, P_SHAPE_POINTS);
|
||||||
m_vertexHelper->resize(points);
|
m_vertexHelper->resize(points);
|
||||||
for (uint32_t point = 0; point < points; point++) {
|
for (uint32_t point = 0; point < points; point++) {
|
||||||
Helper::Vertex& v = m_vertexHelper->at(point);
|
GS::Vertex& v = m_vertexHelper->at(point);
|
||||||
{
|
{
|
||||||
auto strings = cache.find(std::make_pair(point,
|
auto strings = cache.find(std::make_pair(point,
|
||||||
P_SHAPE_POINT_X));
|
P_SHAPE_POINT_X));
|
||||||
|
@ -301,7 +301,7 @@ void Filter::Shape::Instance::update(obs_data_t *data) {
|
||||||
}
|
}
|
||||||
drawmode = (gs_draw_mode)obs_data_get_int(data, P_SHAPE_MODE);
|
drawmode = (gs_draw_mode)obs_data_get_int(data, P_SHAPE_MODE);
|
||||||
obs_enter_graphics();
|
obs_enter_graphics();
|
||||||
m_vertexBuffer = m_vertexHelper->update();
|
m_vertexBuffer = m_vertexHelper->get();
|
||||||
obs_leave_graphics();
|
obs_leave_graphics();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "gs-helper.h"
|
#include "gs-vertexbuffer.h"
|
||||||
|
|
||||||
#define P_SHAPE "Shape"
|
#define P_SHAPE "Shape"
|
||||||
#define P_SHAPE_LOOP "Shape.Loop"
|
#define P_SHAPE_LOOP "Shape.Loop"
|
||||||
|
@ -78,7 +78,7 @@ namespace Filter {
|
||||||
private:
|
private:
|
||||||
obs_source_t *context;
|
obs_source_t *context;
|
||||||
gs_effect_t *customEffect;
|
gs_effect_t *customEffect;
|
||||||
Helper::VertexBuffer *m_vertexHelper;
|
GS::VertexBuffer *m_vertexHelper;
|
||||||
gs_vertbuffer_t *m_vertexBuffer;
|
gs_vertbuffer_t *m_vertexBuffer;
|
||||||
gs_draw_mode drawmode;
|
gs_draw_mode drawmode;
|
||||||
gs_texrender_t *m_texRender;
|
gs_texrender_t *m_texRender;
|
||||||
|
|
Loading…
Reference in a new issue