obs-StreamFX/source/gfx/gfx-util.hpp

42 lines
1.3 KiB
C++
Raw Normal View History

// AUTOGENERATED COPYRIGHT HEADER START
// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
// AUTOGENERATED COPYRIGHT HEADER END
#pragma once
#include "obs/gs/gs-effect.hpp"
#include "obs/gs/gs-vertexbuffer.hpp"
#include "warning-disable.hpp"
#include <memory>
#include "warning-enable.hpp"
namespace streamfx::gfx {
class util {
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;
std::shared_ptr<::streamfx::obs::gs::vertex_buffer> _fstri_vb;
public /* Singleton */:
static std::shared_ptr<streamfx::gfx::util> get();
private:
util();
public:
~util();
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);
void draw_fullscreen_triangle();
};
} // namespace streamfx::gfx