mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 02:07:54 -06:00
1st attempt to fix opengl initialization on linux
This commit is contained in:
parent
adca3035f9
commit
ac47ba5864
7 changed files with 119 additions and 51 deletions
|
@ -1757,10 +1757,17 @@ void _3DScene::remove_all_canvases()
|
||||||
std::cout << "# canvases not yet released: " << s_canvas_mgr.count() << std::endl;
|
std::cout << "# canvases not yet released: " << s_canvas_mgr.count() << std::endl;
|
||||||
s_canvas_mgr.remove_all();
|
s_canvas_mgr.remove_all();
|
||||||
}
|
}
|
||||||
bool _3DScene::init(wxGLCanvas* canvas, bool useVBOs)
|
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
bool _3DScene::init(wxGLCanvas* canvas)
|
||||||
{
|
{
|
||||||
return s_canvas_mgr.init(canvas, useVBOs);
|
return s_canvas_mgr.init(canvas);
|
||||||
}
|
}
|
||||||
|
//bool _3DScene::init(wxGLCanvas* canvas, bool useVBOs)
|
||||||
|
//{
|
||||||
|
// return s_canvas_mgr.init(canvas, useVBOs);
|
||||||
|
//}
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
bool _3DScene::is_shown_on_screen(wxGLCanvas* canvas)
|
bool _3DScene::is_shown_on_screen(wxGLCanvas* canvas)
|
||||||
{
|
{
|
||||||
|
|
|
@ -545,7 +545,10 @@ public:
|
||||||
static bool remove_canvas(wxGLCanvas* canvas);
|
static bool remove_canvas(wxGLCanvas* canvas);
|
||||||
static void remove_all_canvases();
|
static void remove_all_canvases();
|
||||||
|
|
||||||
static bool init(wxGLCanvas* canvas, bool useVBOs);
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
static bool init(wxGLCanvas* canvas);
|
||||||
|
// static bool init(wxGLCanvas* canvas, bool useVBOs);
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
static bool is_shown_on_screen(wxGLCanvas* canvas);
|
static bool is_shown_on_screen(wxGLCanvas* canvas);
|
||||||
|
|
||||||
|
|
|
@ -575,7 +575,7 @@ bool GLCanvas3D::LayersEditing::init(const std::string& vertex_shader_filename,
|
||||||
|
|
||||||
bool GLCanvas3D::LayersEditing::is_allowed() const
|
bool GLCanvas3D::LayersEditing::is_allowed() const
|
||||||
{
|
{
|
||||||
return m_use_legacy_opengl && m_shader.is_initialized();
|
return !m_use_legacy_opengl && m_shader.is_initialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLCanvas3D::LayersEditing::set_use_legacy_opengl(bool use_legacy_opengl)
|
void GLCanvas3D::LayersEditing::set_use_legacy_opengl(bool use_legacy_opengl)
|
||||||
|
@ -943,7 +943,10 @@ GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas, wxGLContext* context)
|
||||||
, m_print(nullptr)
|
, m_print(nullptr)
|
||||||
, m_dirty(true)
|
, m_dirty(true)
|
||||||
, m_use_VBOs(false)
|
, m_use_VBOs(false)
|
||||||
, m_late_init(false)
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
, m_first_render(true)
|
||||||
|
// , m_late_init(false)
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
, m_apply_zoom_to_volumes_filter(false)
|
, m_apply_zoom_to_volumes_filter(false)
|
||||||
, m_hover_volume_id(-1)
|
, m_hover_volume_id(-1)
|
||||||
, m_warning_texture_enabled(false)
|
, m_warning_texture_enabled(false)
|
||||||
|
@ -970,8 +973,10 @@ GLCanvas3D::~GLCanvas3D()
|
||||||
|
|
||||||
bool GLCanvas3D::init(bool useVBOs, bool use_legacy_opengl)
|
bool GLCanvas3D::init(bool useVBOs, bool use_legacy_opengl)
|
||||||
{
|
{
|
||||||
if (!set_current())
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
return false;
|
// if (!set_current())
|
||||||
|
// return false;
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
::glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
::glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
::glClearDepth(1.0f);
|
::glClearDepth(1.0f);
|
||||||
|
@ -1022,8 +1027,19 @@ bool GLCanvas3D::init(bool useVBOs, bool use_legacy_opengl)
|
||||||
if (useVBOs && !m_layers_editing.init("variable_layer_height.vs", "variable_layer_height.fs"))
|
if (useVBOs && !m_layers_editing.init("variable_layer_height.vs", "variable_layer_height.fs"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
// This is a special path for wxWidgets on GTK, where an OpenGL context is initialized
|
||||||
|
// first when an OpenGL widget is shown for the first time. How ugly.
|
||||||
|
// In that case the volumes are wainting to be moved to Vertex Buffer Objects
|
||||||
|
// after the OpenGL context is being initialized.
|
||||||
|
#if defined(__LINUX__)
|
||||||
|
if (use_VBOs && (m_volumes != nullptr))
|
||||||
|
m_volumes->finalize_geometry(use_VBOs);
|
||||||
|
#endif // __LINUX__
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
m_use_VBOs = useVBOs;
|
m_use_VBOs = useVBOs;
|
||||||
m_layers_editing.set_use_legacy_opengl(!use_legacy_opengl);
|
m_layers_editing.set_use_legacy_opengl(use_legacy_opengl);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1264,8 +1280,17 @@ void GLCanvas3D::render()
|
||||||
if (!set_current())
|
if (!set_current())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!m_late_init)
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
_late_init();
|
if (!_3DScene::init(m_canvas))
|
||||||
|
return;
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
if (m_first_render)
|
||||||
|
_before_first_render();
|
||||||
|
// if (!m_late_init)
|
||||||
|
// _late_init();
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
_camera_tranform();
|
_camera_tranform();
|
||||||
|
|
||||||
|
@ -1719,19 +1744,27 @@ Point GLCanvas3D::get_local_mouse_position() const
|
||||||
return Point(mouse_pos.x, mouse_pos.y);
|
return Point(mouse_pos.x, mouse_pos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLCanvas3D::_late_init()
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
void GLCanvas3D::_before_first_render()
|
||||||
|
//void GLCanvas3D::_late_init()
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
{
|
{
|
||||||
// This is a special path for wxWidgets on GTK, where an OpenGL context is initialized
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
// first when an OpenGL widget is shown for the first time.How ugly.
|
// // This is a special path for wxWidgets on GTK, where an OpenGL context is initialized
|
||||||
// In that case the volumes are wainting to be moved to Vertex Buffer Objects
|
// // first when an OpenGL widget is shown for the first time. How ugly.
|
||||||
// after the OpenGL context is being initialized.
|
// // In that case the volumes are wainting to be moved to Vertex Buffer Objects
|
||||||
#if defined(__LINUX__)
|
// // after the OpenGL context is being initialized.
|
||||||
if (m_use_VBOs && (m_volumes != nullptr))
|
//#if defined(__LINUX__)
|
||||||
m_volumes->finalize_geometry(m_use_VBOs);
|
// if (m_use_VBOs && (m_volumes != nullptr))
|
||||||
#endif // __LINUX__
|
// m_volumes->finalize_geometry(m_use_VBOs);
|
||||||
|
//#endif // __LINUX__
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
zoom_to_bed();
|
zoom_to_bed();
|
||||||
m_late_init = true;
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
m_first_render = false;
|
||||||
|
// m_late_init = true;
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLCanvas3D::_resize(unsigned int w, unsigned int h)
|
void GLCanvas3D::_resize(unsigned int w, unsigned int h)
|
||||||
|
|
|
@ -303,7 +303,10 @@ private:
|
||||||
|
|
||||||
bool m_dirty;
|
bool m_dirty;
|
||||||
bool m_use_VBOs;
|
bool m_use_VBOs;
|
||||||
bool m_late_init;
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
bool m_first_render;
|
||||||
|
// bool m_late_init;
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
bool m_apply_zoom_to_volumes_filter;
|
bool m_apply_zoom_to_volumes_filter;
|
||||||
mutable int m_hover_volume_id;
|
mutable int m_hover_volume_id;
|
||||||
bool m_warning_texture_enabled;
|
bool m_warning_texture_enabled;
|
||||||
|
@ -394,7 +397,10 @@ public:
|
||||||
Point get_local_mouse_position() const;
|
Point get_local_mouse_position() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _late_init();
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
void _before_first_render();
|
||||||
|
// void _late_init();
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
void _resize(unsigned int w, unsigned int h);
|
void _resize(unsigned int w, unsigned int h);
|
||||||
|
|
||||||
|
|
|
@ -138,18 +138,20 @@ bool GLCanvas3DManager::add(wxGLCanvas* canvas, wxGLContext* context)
|
||||||
if (canvas3D == nullptr)
|
if (canvas3D == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!m_gl_initialized)
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
{
|
// if (!m_gl_initialized)
|
||||||
canvas3D->set_current();
|
// {
|
||||||
init_gl();
|
// canvas3D->set_current();
|
||||||
}
|
// init_gl();
|
||||||
|
// }
|
||||||
if (!canvas3D->init(m_use_VBOs, m_use_legacy_opengl))
|
//
|
||||||
{
|
// if (!canvas3D->init(m_use_VBOs, m_use_legacy_opengl))
|
||||||
delete canvas3D;
|
// {
|
||||||
canvas3D = nullptr;
|
// delete canvas3D;
|
||||||
return false;
|
// canvas3D = nullptr;
|
||||||
}
|
// return false;
|
||||||
|
// }
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
canvas->Bind(wxEVT_SIZE, [canvas3D](wxSizeEvent& evt) { canvas3D->on_size(evt); });
|
canvas->Bind(wxEVT_SIZE, [canvas3D](wxSizeEvent& evt) { canvas3D->on_size(evt); });
|
||||||
canvas->Bind(wxEVT_IDLE, [canvas3D](wxIdleEvent& evt) { canvas3D->on_idle(evt); });
|
canvas->Bind(wxEVT_IDLE, [canvas3D](wxIdleEvent& evt) { canvas3D->on_idle(evt); });
|
||||||
|
@ -239,12 +241,23 @@ bool GLCanvas3DManager::use_VBOs() const
|
||||||
return m_use_VBOs;
|
return m_use_VBOs;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GLCanvas3DManager::init(wxGLCanvas* canvas, bool useVBOs)
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
bool GLCanvas3DManager::init(wxGLCanvas* canvas)
|
||||||
{
|
{
|
||||||
CanvasesMap::const_iterator it = _get_canvas(canvas);
|
CanvasesMap::const_iterator it = _get_canvas(canvas);
|
||||||
return (it != m_canvases.end()) ? it->second->init(useVBOs, m_use_legacy_opengl) : false;
|
if (it != m_canvases.end())
|
||||||
|
return (it->second != nullptr) ? _init(*it->second) : false;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//bool GLCanvas3DManager::init(wxGLCanvas* canvas, bool useVBOs)
|
||||||
|
//{
|
||||||
|
// CanvasesMap::const_iterator it = _get_canvas(canvas);
|
||||||
|
// return (it != m_canvases.end()) ? it->second->init(useVBOs, m_use_legacy_opengl) : false;
|
||||||
|
//}
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
bool GLCanvas3DManager::is_shown_on_screen(wxGLCanvas* canvas) const
|
bool GLCanvas3DManager::is_shown_on_screen(wxGLCanvas* canvas) const
|
||||||
{
|
{
|
||||||
CanvasesMap::const_iterator it = _get_canvas(canvas);
|
CanvasesMap::const_iterator it = _get_canvas(canvas);
|
||||||
|
@ -486,5 +499,18 @@ GLCanvas3DManager::CanvasesMap::const_iterator GLCanvas3DManager::_get_canvas(wx
|
||||||
return (canvas == nullptr) ? m_canvases.end() : m_canvases.find(canvas);
|
return (canvas == nullptr) ? m_canvases.end() : m_canvases.find(canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
bool GLCanvas3DManager::_init(GLCanvas3D& canvas)
|
||||||
|
{
|
||||||
|
if (!m_gl_initialized)
|
||||||
|
{
|
||||||
|
// canvas.set_current();
|
||||||
|
init_gl();
|
||||||
|
}
|
||||||
|
|
||||||
|
return canvas.init(m_use_VBOs, m_use_legacy_opengl);
|
||||||
|
}
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
} // namespace GUI
|
} // namespace GUI
|
||||||
} // namespace Slic3r
|
} // namespace Slic3r
|
||||||
|
|
|
@ -49,7 +49,10 @@ public:
|
||||||
bool use_VBOs() const;
|
bool use_VBOs() const;
|
||||||
bool layer_editing_allowed() const;
|
bool layer_editing_allowed() const;
|
||||||
|
|
||||||
bool init(wxGLCanvas* canvas, bool useVBOs);
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
bool init(wxGLCanvas* canvas);
|
||||||
|
// bool init(wxGLCanvas* canvas, bool useVBOs);
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
bool is_shown_on_screen(wxGLCanvas* canvas) const;
|
bool is_shown_on_screen(wxGLCanvas* canvas) const;
|
||||||
|
|
||||||
|
@ -100,6 +103,10 @@ public:
|
||||||
private:
|
private:
|
||||||
CanvasesMap::iterator _get_canvas(wxGLCanvas* canvas);
|
CanvasesMap::iterator _get_canvas(wxGLCanvas* canvas);
|
||||||
CanvasesMap::const_iterator _get_canvas(wxGLCanvas* canvas) const;
|
CanvasesMap::const_iterator _get_canvas(wxGLCanvas* canvas) const;
|
||||||
|
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
bool _init(GLCanvas3D& canvas);
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace GUI
|
} // namespace GUI
|
||||||
|
|
|
@ -156,11 +156,6 @@ GLVolumeCollection::arrayref()
|
||||||
%package{Slic3r::GUI::_3DScene};
|
%package{Slic3r::GUI::_3DScene};
|
||||||
%{
|
%{
|
||||||
|
|
||||||
void
|
|
||||||
init_gl()
|
|
||||||
CODE:
|
|
||||||
_3DScene::init_gl();
|
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
get_gl_info(format_as_html, extensions)
|
get_gl_info(format_as_html, extensions)
|
||||||
bool format_as_html;
|
bool format_as_html;
|
||||||
|
@ -199,15 +194,6 @@ remove_all_canvases()
|
||||||
CODE:
|
CODE:
|
||||||
_3DScene::remove_all_canvases();
|
_3DScene::remove_all_canvases();
|
||||||
|
|
||||||
bool
|
|
||||||
init(canvas, useVBOs)
|
|
||||||
SV *canvas;
|
|
||||||
bool useVBOs;
|
|
||||||
CODE:
|
|
||||||
RETVAL = _3DScene::init((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), useVBOs);
|
|
||||||
OUTPUT:
|
|
||||||
RETVAL
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
is_shown_on_screen(canvas)
|
is_shown_on_screen(canvas)
|
||||||
SV *canvas;
|
SV *canvas;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue