2023-02-28 01:15:26 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
2021-10-29 07:13:58 +00:00
|
|
|
|
2022-11-28 08:11:55 +00:00
|
|
|
#pragma once
|
2021-10-29 07:13:58 +00:00
|
|
|
#include "obs/gs/gs-effect.hpp"
|
|
|
|
#include "obs/gs/gs-vertexbuffer.hpp"
|
|
|
|
|
2022-08-29 10:29:44 +00:00
|
|
|
#include "warning-disable.hpp"
|
|
|
|
#include <memory>
|
|
|
|
#include "warning-enable.hpp"
|
|
|
|
|
2021-10-29 07:13:58 +00:00
|
|
|
namespace streamfx::gfx {
|
2022-11-28 07:13:31 +00:00
|
|
|
class util {
|
2021-10-29 07:13:58 +00:00
|
|
|
std::shared_ptr<::streamfx::obs::gs::effect> _effect;
|
|
|
|
std::shared_ptr<::streamfx::obs::gs::vertex_buffer> _point_vb;
|
|
|
|
std::shared_ptr<::streamfx::obs::gs::vertex_buffer> _line_vb;
|
|
|
|
std::shared_ptr<::streamfx::obs::gs::vertex_buffer> _arrow_vb;
|
|
|
|
std::shared_ptr<::streamfx::obs::gs::vertex_buffer> _quad_vb;
|
2022-11-28 08:11:55 +00:00
|
|
|
std::shared_ptr<::streamfx::obs::gs::vertex_buffer> _fstri_vb;
|
2021-10-29 07:13:58 +00:00
|
|
|
|
|
|
|
public /* Singleton */:
|
2022-11-28 07:13:31 +00:00
|
|
|
static std::shared_ptr<streamfx::gfx::util> get();
|
2021-10-29 07:13:58 +00:00
|
|
|
|
|
|
|
private:
|
2022-11-28 07:13:31 +00:00
|
|
|
util();
|
2021-10-29 07:13:58 +00:00
|
|
|
|
|
|
|
public:
|
2022-11-28 07:13:31 +00:00
|
|
|
~util();
|
2021-10-29 07:13:58 +00:00
|
|
|
|
|
|
|
void draw_point(float x, float y, uint32_t color = 0xFFFFFFFF);
|
|
|
|
|
|
|
|
void draw_line(float x, float y, float x2, float y2, uint32_t color = 0xFFFFFFFF);
|
|
|
|
|
|
|
|
void draw_arrow(float x, float y, float x2, float y2, float w = 0., uint32_t color = 0xFFFFFFFF);
|
|
|
|
|
|
|
|
void draw_rectangle(float x, float y, float w, float h, bool frame, uint32_t color = 0xFFFFFFFF);
|
2022-11-28 08:11:55 +00:00
|
|
|
|
|
|
|
void draw_fullscreen_triangle();
|
2021-10-29 07:13:58 +00:00
|
|
|
};
|
|
|
|
} // namespace streamfx::gfx
|