mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
First installment of tech ENABLE_SHADERS_MANAGER, using class GLShadersManager as a central point to manage OpenGL shaders
This commit is contained in:
parent
98c2e3c7b1
commit
c7c87973b7
18 changed files with 1415 additions and 47 deletions
31
src/slic3r/GUI/GLShadersManager.hpp
Normal file
31
src/slic3r/GUI/GLShadersManager.hpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
#ifndef slic3r_GLShadersManager_hpp_
|
||||
#define slic3r_GLShadersManager_hpp_
|
||||
|
||||
#if ENABLE_SHADERS_MANAGER
|
||||
|
||||
#include "GLShader.hpp"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class GLShadersManager
|
||||
{
|
||||
std::vector<std::unique_ptr<GLShaderProgram>> m_shaders;
|
||||
|
||||
public:
|
||||
std::pair<bool, std::string> init();
|
||||
// call this method before to release the OpenGL context
|
||||
void shutdown();
|
||||
|
||||
// returns nullptr if not found
|
||||
GLShaderProgram* get_shader(const std::string& shader_name);
|
||||
};
|
||||
|
||||
} // namespace Slic3r
|
||||
|
||||
#endif // ENABLE_SHADERS_MANAGER
|
||||
|
||||
#endif // slic3r_GLShadersManager_hpp_
|
Loading…
Add table
Add a link
Reference in a new issue