blob: 5cc971ca8290bc8a3041575bc441ad1e2370a91d (
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
|
// 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 <map>
#include <string>
#include <bgfx/bgfx.h>
class shader_manager {
public:
shader_manager() {}
~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;
};
#endif // __DRAWBGFX_SHADER_MANAGER__
|