summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/effectmanager.h
blob: 697d468dc5c8e0cd02fda0b2eb983d7352f4624e (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
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
//============================================================
//
//  effectmanager.h - BGFX shader effect manager
//
//  Maintains a string-to-entry lookup of BGFX shader
//  effects, defined by effect.h and read by effectreader.h
//
//============================================================

#ifndef MAME_RENDER_BGFX_EFFECTMANAGER_H
#define MAME_RENDER_BGFX_EFFECTMANAGER_H

#pragma once

#include <map>
#include <memory>
#include <string>


class bgfx_effect;
class osd_options;
class shader_manager;

class effect_manager
{
public:
	effect_manager(shader_manager& shaders);
	~effect_manager();

	// Getters
	bgfx_effect* get_or_load_effect(const osd_options &options, const std::string &name);
	static bool validate_effect(const osd_options &options, const std::string &name);

private:
	bgfx_effect* load_effect(const osd_options &options, const std::string &name);

	shader_manager &m_shaders;
	std::map<std::string, std::unique_ptr<bgfx_effect> > m_effects;
};

#endif // MAME_RENDER_BGFX_EFFECTMANAGER_H