Skip to content

Should we make "multi-draw' functions? #2208

Open
@Starbuck5

Description

@Starbuck5

Some of the oldest PRs in the PR list implement "multi-draw" functions, where it is a fast way to draw a bunch of polygons at once, or a bunch of circles at once.

These are the PRs I'm referring to, by @itzpr3d4t0r: #1841, #1834, #1835, #1839

I'd like to have a discussion about those PRs.

I'm skeptical we want to introduce a bunch of functions where the attraction is doing the same thing as another function but with less function call overhead.

I don't want to use a slippery slope argument, but the same logic around these draw functions applies to many other places in the codebase. If we want a multi polygon draw, why wouldn't we want a multi surface transform scale, or a multi image rotate, or a multi text render (I feel like these are not good examples but it's late for me). I guess we already have blits and colliderects, and those seem reasonable.

In the case of draw.polygons, the provided test case uses a very small and low impact polygon. (triangle, width=2, dim=20) and shows a good improvement there. But of course larger more complex polygons, filled polygons make the performance impact negligible eventually. I'm not sure what my point with that is, I'm sure everyone is aware of that.

Is it worth trying to spruce up the draw module in this way while we're not sure how drawing and _sdl2.video will work together?

Is there a compelling use case for polygons (3d rendering enthusiasts?) that means it should exist and nclines / circles shouldn't?

Metadata

Metadata

Assignees

No one assigned

    Labels

    drawpygame.draw

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions