summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/frameparameter.cpp
blob: 841d4d0d2e52516e3cc027f30a769103e7d41b82 (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
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
//============================================================
//
//  frameparameter.cpp - Frame-based dynamic shader param
//
//============================================================

#include "frameparameter.h"

bgfx_frame_parameter::bgfx_frame_parameter(std::string name, parameter_type type, uint32_t period)
	: bgfx_parameter(name, type)
	, m_current_frame(0)
	, m_period(period)
{
}

float bgfx_frame_parameter::value()
{
	return float(m_current_frame);
}

void bgfx_frame_parameter::tick(double /*delta*/)
{
	m_current_frame++;
	m_current_frame %= m_period;
}