summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/chainmanager.h
blob: e4527cd81c01bda9933ff04a4bd28de3e852ce2c (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
46
47
48
49
50
51
52
53
54
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
//============================================================
//
//  chainmanager.h - BGFX shader chain manager
//
//  Maintains a string-to-entry lookup of BGFX shader
//  effect chains, defined by chain.h and read by chainreader.h
//
//============================================================

#pragma once

#ifndef __DRAWBGFX_CHAIN_MANAGER__
#define __DRAWBGFX_CHAIN_MANAGER__

#include <map>
#include <string>

#include "texturemanager.h"
#include "targetmanager.h"
#include "effectmanager.h"

class running_machine;

class bgfx_chain;

class chain_manager {
public:
	chain_manager(texture_manager& textures, target_manager& targets, effect_manager& effects, uint32_t width, uint32_t height)
		: m_textures(textures)
		, m_targets(targets)
		, m_effects(effects)
		, m_width(width)
		, m_height(height)
	{
	}
	~chain_manager();

	// Getters
	bgfx_chain* chain(std::string name, running_machine& machine);

private:
	bgfx_chain* load_chain(std::string name, running_machine& machine);

	texture_manager&					m_textures;
	target_manager&						m_targets;
	effect_manager&                     m_effects;
	uint32_t							m_width;
	uint32_t							m_height;
	std::map<std::string, bgfx_chain*>	m_chains;
};

#endif // __DRAWBGFX_CHAIN_MANAGER__