Conversation
This implements a minimal OpenGLView widget for many backends. This widget merely sets up an OpenGL context, and calls back to user code to do the rendering with whatever OpenGL API is appropriate. Includes basic documentation and an example.
| fitting_size = self.native.fittingSize() | ||
| self.interface.intrinsic.height = at_least(fitting_size.height) | ||
| self.interface.intrinsic.width = at_least(fitting_size.width) |
There was a problem hiding this comment.
Here this value is 0 on cocoa. Same may be occuring on other backends -- it'd be wise to take the maximum of the native fitting size and self.interface._MIN_WIDTH and self.interface._MIN_HEIGHT (defined in core base.py).
I understand that you did not ask for a review, but since this is not in your TODO list, I'd like to bring this to attn.
Thank you.
There was a problem hiding this comment.
Hmm... I stole borrowed that from the Canvas widget. I figured that I want the same logic for the size of the widget.
There was a problem hiding this comment.
In which case it may be appropriate to not enforce a minimum size. I apologize for not researching those precedents in advance.
You may resolve this comment now. I brought this up because I got a "singular matrix" eror when I resized toga-chart to 0 size...
There was a problem hiding this comment.
There shouldn't be a minimum size, per-se, but having it at least be positive might be a good idea. In any case it's a wider issue than just this.
Should cover everything except Gtk 4.
Really should use Pyglet's high-level API.
This implements a minimal
OpenGLViewwidget for Android, Cocoa, Gtk, iOS and Qt. This widget merely sets up an OpenGL context, and calls back to user code to do the rendering with whatever OpenGL API is appropriate.Includes documentation and an example.
NOTE: To test in an existing installation you will need to run
pip install -e "./cocoa" --no-deps(or./qt, etc) to pick up the new entrypoint for the OpenGL widget.Things to be resolved:
Nice to haves (mostly in examples, possibly for later PRs):
Better iOS support for OpenGL.Show Qt GL bindings in example.Ref #51
Fixes #4273
PR Checklist: