1 // license:BSD-3-Clause
2 // copyright-holders:Ryan Holtz
3 //============================================================
4 //
5 //  effectmanager.h - BGFX shader effect manager
6 //
7 //  Maintains a string-to-entry lookup of BGFX shader
8 //  effects, defined by effect.h and read by effectreader.h
9 //
10 //============================================================
11 
12 #pragma once
13 
14 #ifndef __DRAWBGFX_EFFECT_MANAGER__
15 #define __DRAWBGFX_EFFECT_MANAGER__
16 
17 #include <map>
18 #include <string>
19 
20 #include <bgfx/bgfx.h>
21 
22 #include "shadermanager.h"
23 
24 class bgfx_effect;
25 
26 class effect_manager {
27 public:
effect_manager(osd_options & options,shader_manager & shaders)28 	effect_manager(osd_options& options, shader_manager& shaders) : m_options(options), m_shaders(shaders) { }
29 	~effect_manager();
30 
31 	// Getters
32 	bgfx_effect* effect(std::string name);
33 
34 private:
35 	bgfx_effect* load_effect(std::string name);
36 
37 	osd_options&                        m_options;
38 	shader_manager&                     m_shaders;
39 	std::map<std::string, bgfx_effect*> m_effects;
40 };
41 
42 #endif // __DRAWBGFX_EFFECT_MANAGER__
43