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

Range fix on draw command #98

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Conversation

Evan-Bertis-Sample
Copy link
Contributor

I believe that this line is incorrect. It looks like it is supposed to correct the range given by the draw command, if it is invalid. From my interpretation, the line basically is saying:

If the end of the range was provided in the draw command description, and the range end is before the start (thus an invalid range), use the provided range end. Else, use the count provided in the description as the end.

That makes no sense imo, and goes against what I see in the openGL docs. The end of a range should never be before the start of a range.

I corrected the logic to say:

If the end of the range was provided in the draw command description, and the range end is after the start (thus valid), use the provided range end. Otherwise, calculate a new range end based on the provided count.

I was pulling my hair out trying to figure out if I was doing something wrong lol. If this is intended behavior, it is pretty confusing, and I think some comments should be added to the gs_graphics_draw_desc_t struct. Love the framework btw, using it to learn a lot about C.

@MrFrenik
Copy link
Owner

Good catch, you're correct, that logic is wrong on my part. Sorry for the headache and confusion on that one, and thanks for the comment and PR.

@MrFrenik MrFrenik merged commit e6fb33b into MrFrenik:master Jul 15, 2024
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