Closed khokm closed 6 months ago
You might be right. This is the reason for: https://github.com/jonwright/pyopengltk/blob/2df4fca4da54923f5dbfaa49c084e4857f2d6f67/pyopengltk/opengl.py#L90
If we change it now I guess it is going to break people's code if they are expecting to get an initgl whenever there was a resize (for example, to resize their buffers).
What do you think we should do?
I'm guessing tkResize
could be overidden in a subclass. I'm guessing initgl
should only be called if the context was destroyed for some reason.
So one idea would be to add a function like "initcontext" for those things like loading shaders and add some comments saying which one is going to be called and when. Would that fix the problem without requiring changes to code that is using this package and relying on initgl for the viewport changes when a window resizes ?
https://github.com/jonwright/pyopengltk/blob/2df4fca4da54923f5dbfaa49c084e4857f2d6f67/pyopengltk/base.py#L93 initgl should not be called here, because in
initgl
we usually init buffers, shader programs and do many other things that must be done only once.