summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/parameter.h
blob: baa2ff017ad60dca98d6656e2613b467c0d453a0 (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
38
39
40
41
42
43
44
45
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
//============================================================
//
//  parameter.h - BGFX shader parameter
//
//  A value that represents some form of parametric
//  operation, which can be fed to the input of a BGFX
//  shader uniform.
//
//============================================================

#ifndef MAME_RENDER_BGFX_PARAMETER_H
#define MAME_RENDER_BGFX_PARAMETER_H

#pragma once

#include <string>
#include <utility>

class bgfx_parameter
{
public:
	enum parameter_type
	{
		PARAM_FRAME,
		PARAM_WINDOW,
		PARAM_TIME
	};

	bgfx_parameter(std::string &&name, parameter_type type) : m_name(std::move(name)), m_type(type) { }
	virtual ~bgfx_parameter() = default;

	virtual void tick(double delta) = 0;

	// Getters
	virtual float value() = 0;
	const std::string &name() const { return m_name; }

protected:
	std::string m_name;
	parameter_type m_type;
};

#endif // MAME_RENDER_BGFX_PARAMETER_H