+#include <map>
+
+#include "shader_manager.h"
+#include "opengl/shader-gl.h"
+
+extern bool use_vulkan;
+
+ShaderManager::ShaderManager() {}
+ShaderManager::~ShaderManager() {}
+
+void ShaderManager::add_shader(Shader *sdr, const char *name)
+{
+ shaders[name] = sdr;
+}
+
+Shader *ShaderManager::load_shader(const char *name, SType type)
+{
+ std::map<std::string, Shader*>::const_iterator it;
+ it = shaders.find(name);
+
+ if(it != shaders.end()) {
+ return it->second;
+ }
+
+ Shader* sdr;
+ if(use_vulkan) {
+ // sdr = new ShaderVK;
+ }
+ else {
+ sdr = new ShaderGL;
+ }
+
+ if(!sdr->load(name, type)) {
+ delete sdr;
+ return 0;
+ }
+
+ add_shader(sdr, name);
+ return sdr;
+}
+
+void ShaderManager::delete_shaders()
+{
+ std::map<std::string, Shader *>::iterator it;
+ for(it=shaders.begin(); it != shaders.end(); it++) {
+ delete it->second;
+ }
+}
\ No newline at end of file