summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/effect.h
blob: b44b6a8fb72093c6747c26ba4a369abecefe04fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
//============================================================
//
//  vertex.h - BGFX screen vertex data
//
//============================================================

#pragma once

#ifndef __DRAWBGFX_EFFECT__
#define __DRAWBGFX_EFFECT__

#include <bgfx/bgfx.h>

#include <vector>
#include <map>

class bgfx_uniform;

class bgfx_effect
{
public:
    bgfx_effect(uint64_t state, bgfx::ShaderHandle vertex_shader, bgfx::ShaderHandle fragment_shader, std::vector<bgfx_uniform*> uniforms);
    ~bgfx_effect();

    void submit(int view, uint64_t blend = 0L);
    bgfx_uniform* uniform(std::string name);
    bool has_uniform(std::string name);

private:
    uint64_t                             m_state;
    bgfx::ProgramHandle                  m_program_handle;
    std::map<std::string, bgfx_uniform*> m_uniforms;
};

#endif // __DRAWBGFX_EFFECT__