
GL.ShaderSource asks for Length of an array
Posted Thursday, 19 August, 2010 - 17:16 by hannesh| Project: | The Open Toolkit library |
| Version: | all versions |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | by design |
Jump to:
Description
Some of the overloads of GL.ShaderSource() require me to give the Length and Count of the string array i'm passing.
I know why this was neccasary in C/C++, but the function can be re-written to get the Length of the array internally.


Comments
#1
The binding generator cannot eliminate length parameters automatically, because it doesn't have (and cannot infer) that information in the general case. For instance, some functions consider length as the byte-size of the array, while others expect length to be the number of elements (and then multiply that with the element size internally) - and while the gl.spec contains 'length' attributes but they are not consistent enough to use reliably.
However, what we can do is provide hand-written overloads that eliminate lengths - as is the case for GL.ShaderSource. If you come across any functions that are missing such overloads, feel free to post feature requests!