Merge branch 'master' of https://github.com/prusa3d/Slic3r into opengl_to_cpp

This commit is contained in:
Enrico Turri 2018-06-27 13:52:57 +02:00
commit 48915a65fd
9 changed files with 29 additions and 126 deletions

View file

@ -114,20 +114,13 @@ std::string GLCanvas3DManager::GLInfo::to_string(bool format_as_html, bool exten
}
GLCanvas3DManager::GLCanvas3DManager()
: m_context(nullptr)
, m_current(nullptr)
: m_current(nullptr)
, m_gl_initialized(false)
, m_use_legacy_opengl(false)
, m_use_VBOs(false)
{
}
GLCanvas3DManager::~GLCanvas3DManager()
{
if (m_context != nullptr)
delete m_context;
}
bool GLCanvas3DManager::add(wxGLCanvas* canvas)
{
if (canvas == nullptr)
@ -136,14 +129,7 @@ bool GLCanvas3DManager::add(wxGLCanvas* canvas)
if (_get_canvas(canvas) != m_canvases.end())
return false;
if (m_context == nullptr)
{
m_context = new wxGLContext(canvas);
if (m_context == nullptr)
return false;
}
GLCanvas3D* canvas3D = new GLCanvas3D(canvas, m_context);
GLCanvas3D* canvas3D = new GLCanvas3D(canvas);
if (canvas3D == nullptr)
return false;
@ -213,41 +199,6 @@ bool GLCanvas3DManager::init(wxGLCanvas* canvas)
return false;
}
bool GLCanvas3DManager::set_current(wxGLCanvas* canvas, bool force)
{
// given canvas is already current, return
if (m_current == canvas)
return true;
if (canvas == nullptr)
{
m_current = nullptr;
return true;
}
// set given canvas as current
CanvasesMap::iterator it = _get_canvas(canvas);
if (it != m_canvases.end())
{
bool res = it->second->set_current(force);
if (res)
{
m_current = canvas;
return true;
}
}
m_current = nullptr;
return false;
}
void GLCanvas3DManager::set_active(wxGLCanvas* canvas, bool active)
{
CanvasesMap::iterator it = _get_canvas(canvas);
if (it != m_canvases.end())
it->second->set_active(active);
}
void GLCanvas3DManager::set_as_dirty(wxGLCanvas* canvas)
{
CanvasesMap::iterator it = _get_canvas(canvas);