OpenGL Widget: Proof of concept#4263
Conversation
| @@ -0,0 +1,19 @@ | |||
| # Button | |||
There was a problem hiding this comment.
Flagging that this file needs updating
|
|
||
| def callback_render(self, widget, context, **kwargs): | ||
| context.clear_color(1.0, 1.0, 0.0, 1.0) | ||
| context.clear(context.COLOR_BUFFER_BIT) |
There was a problem hiding this comment.
If we have an OpenGL example app that doesn't draw a teapot, I'm going to be very disappointed... 😝
More seriously - I presume this is "first light" for the API, rather than anything close to a final API?
There was a problem hiding this comment.
Yes, very much - this is in the 'investigation' phase - the focus so far is on "what does it involve to get an OpenGL view on various platforms", which I think I've mostly got a handle on, so I'm now moving on to "what are the differences/commonalities between the platform OpenGL implementations."
I've been making notes and recording thoughts in #51.
Edit: I'm at the "how do I draw a cross-platform triangle" stage. But yes, there should be a teapot at some point.
|
I've run into a serious problem:
I don't think we can test OpenGL stuff using testbed. |
Hrm... the test suite executes in a separate thread, but the actual app should be entirely on the main thread, and the way pytest-asyncio operates, all the test cases should be "run_coroutine_threadsafe" on the main event loop... |
A little bit more fiddling, and it's the fixtures which are the problem. In particular, the By avoiding passing the widget in as a fixture I can stop the segfaults. Still getting test failures on cocoa, but not hard crashes. Edit: and if I make the widget fixture |
|
I'm going to close this in favour of #4279. There are things in this branch which may eventually make their way into Toga, but I think it needs to be done in more organised steps. |
Yes this was my advice on the Qt tree view issue. async functions are ran — the way it happens is it’s created as a task, which is explicitly forwarded by us to main thread in our testing setup. |
This is a first cut at seeing what an
OpenGLViewwidget might look like. Goals for this are:Currently supports:
Ref #51
PR Checklist: