Closed svenevs closed 6 years ago
These changes both look great. Please feel free to submit a PR and I'll merge it. It would be nice if the new functions also have matching Python bindings.
Sounds good. For the shader, do you want the separate class ExposedGLShader
, or pass through methods added to the existing one
For Python, I'm not sure how I would return pointers. So maybe the methods return a GLuint
instead? The downside is nullptr
is a good trap state. Another alternative woul be returning a GLShader::Buffer &
, but if it isn't available throw an exception?
There are two things I constantly modify by inheriting from these classes and providing public access. Both are simple enough that it really makes no difference to me whether or not they go in the upstream. I just use them often enough that they may be good candidates.
Arcball
This one may be a good candidate to just add to the
Arcball
class, without needing to expose anything:It's useful to be able to "close" the state without an actual mouse release. I use the
Arcball
to model a simple camera model for interacting with the scene, but if an event occurs that issues say aMessageDialog
, or really any other widgets become in focus, I can simply callinterrupt
to prevent some glitchy re-interaction (sincemLastPos
and the new click location may be very different).GLShader
Don't make the
GLShader::Buffer
orGLShader::mBuffer
protected
. This one is a little more specialized. Docs could be added stating plainly "you break it you buy it" -- users who choose to directly read / modify these values should be cautious and well...really need to know what they're doing.The standard use case for me is CUDA / OpenGL interop. If I want to write to the positions of a shader or something, I need the specific
GLuint
associated with this attribute to map a pointer with CUDA. The class I wrote a long time ago that really doesn't need a template, but has it anyway:Upstream fixes would either be exposing the
GLShader::Buffer
class, or possibly just adding theExposedGLShader
class. Or neither.Let me know if you think either of these are desirable.