Closed totalgee closed 2 years ago
Bump...? 😉
I believe there was a specific reason for this though I can't remember exactly what that was. Something @andrewfb found as an optimization when there were many many ScopedVao
s and ScopedGlslProg
s (I think it was related to the Earth sample).
Actually, these changes shouldn't affect anything to do with whether the Scoped object (GlslProg or Vao) has const or non-const access, because this is just the shared_ptr
(the "Ref") we're talking about. I see that some of the Scoped helpers take a const pointer (GlslProg) vs a non-const (Vao), but this won't be affected by this PR. (also, ScopedGlslProg
actually takes a shared_ptr
to a const GlslProg). Anyhow, it's not super important and I do get what you're saying @richardeakin , but the truth is that making the shared_ptr
argument itself const reference or not should make no difference, since the constructor then takes a pointer to the pointed-to object using get()
. Do you want to integrate this, or should I retract it?
Minor change, just to be consistent with other scoped Ref types, and allowing const
draw()
methods to use these scoped objects.