hannesh's picture

GL.ShaderSource asks for Length of an array

Project:The Open Toolkit library
Version:all versions
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:by design
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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Status:open» by design

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!