question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Graphics stops drawing after a certain number of calls

See original GitHub issue

Expected Behavior

Graphics should be able to draw as much as requested.

Current Behavior

Graphics stops after a certain number of calls.

Possible Solution

Split the calls into a number of graphics calls.

Steps to Reproduce

  • create a new Graphics object
  • in a loop, draw thousands of rectangles
  • notice that Graphics stops drawing new rectangles after a certain number of calls (i think this depends on your hardware)

Environment


I’m trying to build a hexagonal grid tilemap with overlapping tilesets. After abandoning a sprite-per-hex approach, I tried to implement chunking with Graphics using beginTextureFill but then I realized that I wouldn’t be able to have overlaping tiles outside of each chunk since each chunk would be its own texture (Unity seems to have this issue too, which makes me think chunking is impossible for this use case). This means I have to have a single Graphics call for the entire map. But I discovered that there’s an undocumented maximum call limit.

I tried sharing GraphicsGeometry instance across multiple Graphics objects, but that had no effect on this limit.

Is there a way around the limit?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bigtimebuddycommented, May 20, 2020

No, this will be in v5.3.0. If you need a hack, use this.

0reactions
bigtimebuddycommented, Sep 15, 2020

@eranimo this was added #6417 and should be in v5.3.x

https://jsfiddle.net/bigtimebuddy/chtdkz29/

Read more comments on GitHub >

github_iconTop Results From Across the Web

paintComponent not drawing everything until repaint() is called
When I run my program, only the squares are shown. However, I would like the pieces to als be shown when starting the...
Read more >
draw() / Reference / Processing.org
Description. Called directly after setup(), the draw() function continuously executes the lines of code contained inside its block until the program is stopped...
Read more >
Drawing objects disappear while working in AutoCAD
While working in AutoCAD, certain parts of the drawing may disappear, and reappear at random. It may occur while zooming, panning, or saving...
Read more >
Draw calls in a nutshell - Tonči Jukić - Medium
Since a draw call is required for each different material, having a variety of unique objects in a game and multiple different materials,...
Read more >
What Exactly Is a Draw Call (and What Can It Do)?
The number of simple draw calls that a graphics card can process in a second does not have a strong effect on overall...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found