Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding capacity parameter to SpriteBatch ctor #6682

Merged
merged 1 commit into from
Mar 20, 2019
Merged

Adding capacity parameter to SpriteBatch ctor #6682

merged 1 commit into from
Mar 20, 2019

Conversation

mrhelmut
Copy link
Contributor

Hey there,

I'd like to propose the addition of a parameter to the SpriteBatch constructor to have a control over its initial batch items capacity. The intention is to give a finer control of the memory allocations and garbage generation to developers (e.g. increasing the batch size right away to avoid any runtime array resizing).

This PR shouldn't break anything and should remain backward compatible.

@Jjagg @cra0zy @tomspilman

@Jjagg
Copy link
Contributor

Jjagg commented Mar 20, 2019

I like this. Thanks @mrhelmut, merging!

@Jjagg Jjagg merged commit 0bf8a77 into MonoGame:develop Mar 20, 2019
@harry-cpp
Copy link
Member

This is an API change, we shouldn't merge stuff like this without @tomspilman or others consent.

@Jjagg
Copy link
Contributor

Jjagg commented Mar 20, 2019

It's not breaking, straightforward and very minor so I figured it was fine, but yeah.

@tomspilman
Copy link
Member

This is ok... Very easy thing to add that shouldn't cause any troubles on console.

@harry-cpp
Copy link
Member

@harry-cpp
Copy link
Member

I sure do hope somebody gets the reference XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants