summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/shadermanager.h
blob: bee48dcea81c3b042bd2ad8e7332400f3d0c453d (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
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
//============================================================
//
//  shadermanager.h - BGFX shader manager
//
//  Maintains a mapping between strings and BGFX shaders,
//  either vertex or pixel/fragment.
//
//============================================================

#pragma once

#ifndef __DRAWBGFX_SHADER_MANAGER__
#define __DRAWBGFX_SHADER_MANAGER__

#include <bgfx/bgfx.h>

#include "modules/lib/osdobj_common.h"

#include <map>
#include <string>


class shader_manager {
public:
	shader_manager(osd_options& options) : m_options(options) { }
	~shader_manager();

	// Getters
	bgfx::ShaderHandle shader(std::string name);

private:
	bgfx::ShaderHandle load_shader(std::string name);
	static const bgfx::Memory* load_mem(std::string name);

	std::map<std::string, bgfx::ShaderHandle>   m_shaders;
	osd_options&                                m_options;
};

#endif // __DRAWBGFX_SHADER_MANAGER__