Fixed a bug, where the GL context was not being activated with _set_current()

as _set_current() tested for visibility of the window on the screen.

Improved memory management by:
1) Allocating small (around 3MB) vertex buffers to be sent to the GPU.
2) Passing the small vertex buffers to the GPU as quickly as possible.

A bit of copy / paste refactoring into common functions.
This commit is contained in:
bubnikv 2019-08-26 11:12:48 +02:00
parent 9cbfe8f5ef
commit 85d9a16563
4 changed files with 182 additions and 202 deletions
src/slic3r/GUI

View file

@ -585,6 +585,23 @@ int GLVolumeCollection::load_wipe_tower_preview(
return int(this->volumes.size() - 1);
}
GLVolume* GLVolumeCollection::new_toolpath_volume(const float *rgba, size_t reserve_vbo_floats)
{
GLVolume *out = new_nontoolpath_volume(rgba, reserve_vbo_floats);
out->is_extrusion_path = true;
return out;
}
GLVolume* GLVolumeCollection::new_nontoolpath_volume(const float *rgba, size_t reserve_vbo_floats)
{
GLVolume *out = new GLVolume(rgba);
out->is_extrusion_path = false;
// Reserving number of vertices (3x position + 3x color)
out->indexed_vertex_array.reserve(reserve_vbo_floats / 6);
this->volumes.emplace_back(out);
return out;
}
GLVolumeWithIdAndZList volumes_to_render(const GLVolumePtrs& volumes, GLVolumeCollection::ERenderType type, const Transform3d& view_matrix, std::function<bool(const GLVolume&)> filter_func)
{
GLVolumeWithIdAndZList list;