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

View file

@ -522,6 +522,9 @@ public:
int load_wipe_tower_preview(
int obj_idx, float pos_x, float pos_y, float width, float depth, float height, float rotation_angle, bool size_unknown, float brim_width, bool opengl_initialized);
GLVolume* new_toolpath_volume(const float *rgba, size_t reserve_vbo_floats = 0);
GLVolume* new_nontoolpath_volume(const float *rgba, size_t reserve_vbo_floats = 0);
// Render the volumes by OpenGL.
void render(ERenderType type, bool disable_cullface, const Transform3d& view_matrix, std::function<bool(const GLVolume&)> filter_func = std::function<bool(const GLVolume&)>()) const;