fesoliveira014 / yanve

0 stars 0 forks source link

MeshView use ref_wrapper might cause some trouble when instancing #21

Open fesoliveira014 opened 3 years ago

fesoliveira014 commented 3 years ago

Currently MeshView uses a reference_wrapper to hold a reference to a Mesh. This, while correct, might lead to some issues when we want to create an empty view and fill it later on. It also creates a problem in which a MeshView will always be bound to a single Mesh, without the possibility for reassignment.

A fix for this would be to use an optional<reference_wrapper<Mesh>> instead. See include/graphics/gl/mesh.h.