Skip to content

[rlgl] introduced rlStartBatch #4905

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

Closed
wants to merge 1 commit into from

Conversation

brccabral
Copy link
Contributor

I was thinking about #4878 , in the solution I had to call rlSetTexture before every rlBegin, therefore I though that they should merge into one call and avoid problems in the future, so I created rlStartBatch.
I think that if I use rlBegin I would forget rlSetTexture, that's why I created rlStartBatch, so I don't forget to set both mode and textureId.
rlEndBatch only exists because sometimes there are calls to rlSetTexture(0) (maybe merge with rlEnd()?).

I tested bunnymark in RenderDoc, it looks fine (60 fps with max objects).

So, two options

  1. PR [rlgl] Preserve current mode and textureId when switching mode or texture #4878 , and tell users to always call rlSetTexture/rlBegin together
  2. this PR, tell users to call rlStartBatch and maybe deprecate rlSetTexture/rlBegin in the future...

@raysan5
Copy link
Owner

raysan5 commented Apr 22, 2025

@brccabral I prefer to avoid that addition, raylib follows the Begin/End convention on drawing and I prefer to keep it as is.

@raysan5 raysan5 closed this Apr 22, 2025
@brccabral
Copy link
Contributor Author

If the function name is the issue I can just rename it, the idea is more important, to not forget to set mode and textureId at the begin to avoid bug #4874 , but it is your call. Saludos

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.

2 participants