arcade
arcade copied to clipboard
Get control over the global blend state
After opening up for pyglet rendering we need to take control over the global blend state. Currently we enable blending by default, but this isn't necessarily the best option. Pyglet will usually temporarily enable and disable blending in its Groups. For example: drawing text will enable blending and disable before returning.
We might also want to follow this principle. No states are enabled by default and we simply enable what's needed per draw call. We need to evaluate how this affects performance in general.
- Sprites and SpriteList needs to enable blend based on their configiration
- Should users be able to choose if unbuffered shapes should be blended, or should we enforce that?
- .. the list is probably longer
We added back the context manager for now. It might also need to reset the view matrix.
Do any pyglet draw calls modify the view matrix, projection, or viewport? If yes, we must save and reset these values in context manager.
I can't find any pyglet draw calls which modify them. Pyglet lets the user change them, yes, but I can't find where draw calls do this.
I can't find any pyglet draw calls which modify them. Pyglet lets the user change them, yes, but I can't find where draw calls do this.
I'd double check to make sure it isn't setting them through an alternate and unexpected route, e.g. how vertex list objects are usually created through a pyglet ShaderProgram but can also be created through a VertexDomain .
If there aren't any non-obvious routes, the following will probably be enough:
- A brief overview of how and when to use the context manager for pyglet/arcade interop which:
- includes a link target above the section heading.
- is located in appropriate place within the programming guide (Perhaps here? https://api.arcade.academy/en/latest/advanced/opengl_notes.html)
- Brief
.. warning::directives linking the interop section as appropriate