mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -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
|
@ -1,6 +1,12 @@
|
|||
#ifndef slic3r_OpenGLManager_hpp_
|
||||
#define slic3r_OpenGLManager_hpp_
|
||||
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
#if ENABLE_SHADERS_MANAGER
|
||||
#include "GLShadersManager.hpp"
|
||||
#endif // ENABLE_SHADERS_MANAGER
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
class wxWindow;
|
||||
class wxGLCanvas;
|
||||
class wxGLContext;
|
||||
|
@ -70,6 +76,11 @@ private:
|
|||
|
||||
bool m_gl_initialized{ false };
|
||||
wxGLContext* m_context{ nullptr };
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
#if ENABLE_SHADERS_MANAGER
|
||||
GLShadersManager m_shaders_manager;
|
||||
#endif // ENABLE_SHADERS_MANAGER
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
static GLInfo s_gl_info;
|
||||
#if ENABLE_HACK_CLOSING_ON_OSX_10_9_5
|
||||
#ifdef __APPLE__
|
||||
|
@ -86,9 +97,18 @@ public:
|
|||
~OpenGLManager();
|
||||
|
||||
bool init_gl();
|
||||
|
||||
wxGLContext* init_glcontext(wxGLCanvas& canvas);
|
||||
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
#if ENABLE_SHADERS_MANAGER
|
||||
// returns nullptr if not found
|
||||
GLShaderProgram* get_shader(const std::string& shader_name) { return m_shaders_manager.get_shader(shader_name); }
|
||||
|
||||
// // returns 0 if not found
|
||||
// unsigned int get_shader_id(const std::string& shader_name) const { return m_shaders_manager.get_shader_id(shader_name); }
|
||||
#endif // ENABLE_SHADERS_MANAGER
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
static bool are_compressed_textures_supported() { return s_compressed_textures_supported; }
|
||||
static bool can_multisample() { return s_multisample == EMultisampleState::Enabled; }
|
||||
static bool are_framebuffers_supported() { return (s_framebuffers_type != EFramebufferType::Unknown); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue