Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

glGetIntegerv always returns one value, but the spec allows for multiple #8

Closed
lyceel opened this issue Sep 21, 2016 · 1 comment
Closed
Assignees

Comments

@lyceel
Copy link
Contributor

lyceel commented Sep 21, 2016

From @exavolt:
"""
I've found an implementation incompatibilities of glGet* functions. From the spec1, a glGet* function might returns one or more values which varies between parameters. For example, glGetIntegerv(GL_ACTIVE_TEXTURE) returns only one value, while something like glGetIntegerv(GL_VIEWPORT) would return four values. The binding always assume that the functions return only one value which, in many cases, it makes the functions practically useless because they returned only the first value.

I think that this could cause a more serious issue, i.e., buffer overrun, because the buffer provided to hold the returned values might be smaller than the number of value asked by the parameter.

The updated implementation should use a map of parameter names with their respective expected number of values as defined in the spec1. On call, the binding function will allocate the appropriately-sized buffer based on the parameter name before calling its respective actual glGet function.

  • rez

"""

@lyceel lyceel self-assigned this Sep 21, 2016
lyceel added a commit that referenced this issue Sep 21, 2016
Also added some documentation about the limitations on async code when
using OpenGL in Dart to the README.md.
@lyceel
Copy link
Contributor Author

lyceel commented Sep 21, 2016

Fixed glGet*v to return a List of the appropriate type.

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

No branches or pull requests

1 participant