mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 18:25:55 +08:00
Added methods GUI_App::is_gl_version_greater_or_equal_to() and GUI_App::is_glsl_version_greater_or_equal_to()
This commit is contained in:
parent
8a9dbb3414
commit
df010a1d4e
@ -222,6 +222,9 @@ public:
|
|||||||
GLShaderProgram* get_current_shader() { return m_opengl_mgr.get_current_shader(); }
|
GLShaderProgram* get_current_shader() { return m_opengl_mgr.get_current_shader(); }
|
||||||
#endif // ENABLE_SHADERS_MANAGER
|
#endif // ENABLE_SHADERS_MANAGER
|
||||||
|
|
||||||
|
bool is_gl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const { return m_opengl_mgr.get_gl_info().is_version_greater_or_equal_to(major, minor); }
|
||||||
|
bool is_glsl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const { return m_opengl_mgr.get_gl_info().is_glsl_version_greater_or_equal_to(major, minor); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool on_init_inner();
|
bool on_init_inner();
|
||||||
void init_app_config();
|
void init_app_config();
|
||||||
|
@ -130,18 +130,15 @@ void OpenGLManager::GLInfo::detect() const
|
|||||||
m_detected = true;
|
m_detected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpenGLManager::GLInfo::is_version_greater_or_equal_to(unsigned int major, unsigned int minor) const
|
static bool version_greater_or_equal_to(const std::string& version, unsigned int major, unsigned int minor)
|
||||||
{
|
{
|
||||||
if (!m_detected)
|
|
||||||
detect();
|
|
||||||
|
|
||||||
#if ENABLE_SHADERS_MANAGER
|
#if ENABLE_SHADERS_MANAGER
|
||||||
if (m_version == "N/A")
|
if (version == "N/A")
|
||||||
return false;
|
return false;
|
||||||
#endif // ENABLE_SHADERS_MANAGER
|
#endif // ENABLE_SHADERS_MANAGER
|
||||||
|
|
||||||
std::vector<std::string> tokens;
|
std::vector<std::string> tokens;
|
||||||
boost::split(tokens, m_version, boost::is_any_of(" "), boost::token_compress_on);
|
boost::split(tokens, version, boost::is_any_of(" "), boost::token_compress_on);
|
||||||
|
|
||||||
if (tokens.empty())
|
if (tokens.empty())
|
||||||
return false;
|
return false;
|
||||||
@ -166,6 +163,22 @@ bool OpenGLManager::GLInfo::is_version_greater_or_equal_to(unsigned int major, u
|
|||||||
return gl_minor >= minor;
|
return gl_minor >= minor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OpenGLManager::GLInfo::is_version_greater_or_equal_to(unsigned int major, unsigned int minor) const
|
||||||
|
{
|
||||||
|
if (!m_detected)
|
||||||
|
detect();
|
||||||
|
|
||||||
|
return version_greater_or_equal_to(m_version, major, minor);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OpenGLManager::GLInfo::is_glsl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const
|
||||||
|
{
|
||||||
|
if (!m_detected)
|
||||||
|
detect();
|
||||||
|
|
||||||
|
return version_greater_or_equal_to(m_glsl_version, major, minor);
|
||||||
|
}
|
||||||
|
|
||||||
std::string OpenGLManager::GLInfo::to_string(bool format_as_html, bool extensions) const
|
std::string OpenGLManager::GLInfo::to_string(bool format_as_html, bool extensions) const
|
||||||
{
|
{
|
||||||
if (!m_detected)
|
if (!m_detected)
|
||||||
|
@ -45,6 +45,7 @@ public:
|
|||||||
float get_max_anisotropy() const;
|
float get_max_anisotropy() const;
|
||||||
|
|
||||||
bool is_version_greater_or_equal_to(unsigned int major, unsigned int minor) const;
|
bool is_version_greater_or_equal_to(unsigned int major, unsigned int minor) const;
|
||||||
|
bool is_glsl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const;
|
||||||
|
|
||||||
std::string to_string(bool format_as_html, bool extensions) const;
|
std::string to_string(bool format_as_html, bool extensions) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user