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

Support GLboolean return type of WebGL2RenderingContext.getQueryParameter() #333

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leod
Copy link

@leod leod commented Jan 2, 2025

WebGL2RenderingContext.getQueryParameter() returns GLboolean for QUERY_RESULT_AVAILABLE (see documentation). This PR adds support for mapping from GLboolean to u32 in get_query_parameter_u32().

As an alternative, I was considering to add get_query_parameter_bool(), but then realized that no other target has that method.

@grovesNL
Copy link
Owner

grovesNL commented Jan 3, 2025

Thank you! Adding get_query_parameter_bool seems slightly preferable to me because the GLboolean result from glGetQueryObjectuiv could be handled the same way. What do you think?

@leod
Copy link
Author

leod commented Jan 4, 2025

Sure! I think I'll close this PR then and would be happy to give adding get_query_parameter_bool() a try.

Hmm, thinking about this though, a few questions are coming to my mind:

  1. My understanding is that, on native, get_query_parameter_u32() already works for QUERY_RESULT_AVAILABLE. Do we want to keep this behavior or make a breaking change? The latter might be hard to notice for users. If we choose the former, perhaps this PR would still be worth merging for consistency across targets.
  2. Closely related -- how should the u32 / bool variants behave for parameters whose type does not match? Panic?

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