2023-02-28 01:15:26 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// Copyright (C) 2022 lainon <GermanAizek@yandex.ru>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
2017-09-17 19:55:16 +00:00
|
|
|
|
|
|
|
#pragma once
|
2020-04-02 15:02:01 +00:00
|
|
|
#include "common.hpp"
|
2019-12-15 10:13:47 +00:00
|
|
|
#include "gs-effect-parameter.hpp"
|
|
|
|
#include "gs-effect-technique.hpp"
|
2017-09-17 19:55:16 +00:00
|
|
|
|
2022-08-29 10:29:44 +00:00
|
|
|
#include "warning-disable.hpp"
|
|
|
|
#include <filesystem>
|
|
|
|
#include <list>
|
|
|
|
#include "warning-enable.hpp"
|
|
|
|
|
2021-06-08 02:38:24 +00:00
|
|
|
namespace streamfx::obs::gs {
|
2019-12-15 10:39:57 +00:00
|
|
|
class effect : public std::shared_ptr<gs_effect_t> {
|
2017-09-17 19:55:16 +00:00
|
|
|
public:
|
2022-07-21 11:09:10 +00:00
|
|
|
effect() = default;
|
|
|
|
effect(std::string_view code, std::string_view name);
|
2019-12-15 10:13:47 +00:00
|
|
|
effect(std::filesystem::path file);
|
|
|
|
~effect();
|
2019-08-07 14:11:09 +00:00
|
|
|
|
2021-06-08 02:38:24 +00:00
|
|
|
std::size_t count_techniques();
|
|
|
|
streamfx::obs::gs::effect_technique get_technique(std::size_t idx);
|
2022-07-21 11:09:10 +00:00
|
|
|
streamfx::obs::gs::effect_technique get_technique(std::string_view name);
|
|
|
|
bool has_technique(std::string_view name);
|
2019-08-07 14:11:09 +00:00
|
|
|
|
2021-06-08 02:38:24 +00:00
|
|
|
std::size_t count_parameters();
|
|
|
|
streamfx::obs::gs::effect_parameter get_parameter(std::size_t idx);
|
2022-07-21 11:09:10 +00:00
|
|
|
streamfx::obs::gs::effect_parameter get_parameter(std::string_view name);
|
|
|
|
bool has_parameter(std::string_view name);
|
|
|
|
bool has_parameter(std::string_view name, effect_parameter::type type);
|
2019-08-07 14:11:09 +00:00
|
|
|
|
2019-12-15 10:13:47 +00:00
|
|
|
public /* Legacy Support */:
|
|
|
|
inline gs_effect_t* get_object()
|
2019-08-07 14:11:09 +00:00
|
|
|
{
|
2019-12-15 10:13:47 +00:00
|
|
|
return get();
|
|
|
|
}
|
2019-08-07 14:11:09 +00:00
|
|
|
|
2022-07-21 11:09:10 +00:00
|
|
|
static streamfx::obs::gs::effect create(std::string_view code, std::string_view name)
|
2021-11-07 13:37:05 +00:00
|
|
|
{
|
|
|
|
return streamfx::obs::gs::effect(code, name);
|
|
|
|
};
|
|
|
|
|
2022-07-21 11:09:10 +00:00
|
|
|
static streamfx::obs::gs::effect create(std::string_view file)
|
2019-08-07 14:11:09 +00:00
|
|
|
{
|
2021-11-07 13:37:05 +00:00
|
|
|
return streamfx::obs::gs::effect(std::filesystem::path(file));
|
2019-08-07 14:11:09 +00:00
|
|
|
};
|
2019-12-21 17:20:36 +00:00
|
|
|
|
2021-11-07 13:37:05 +00:00
|
|
|
static streamfx::obs::gs::effect create(const std::filesystem::path& file)
|
2019-08-07 14:11:09 +00:00
|
|
|
{
|
2021-11-07 13:37:05 +00:00
|
|
|
return streamfx::obs::gs::effect(file);
|
2019-08-07 14:11:09 +00:00
|
|
|
};
|
2017-09-17 19:55:16 +00:00
|
|
|
};
|
2021-06-08 02:38:24 +00:00
|
|
|
} // namespace streamfx::obs::gs
|