
[GL] let GetUniformName() return String
Posted Friday, 2 October, 2009 - 17:57 by kvark| Project: | The Open Toolkit library |
| Version: | 0.9.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
We are programming in .NET, so why should we bother about char buffer length?
It would be very convenient to have some methods return the value instead of accepting the pointer to it.


Comments
#1
Shaders enjoy helper overloads that hide the StringBuilder/char pointer ugliness. We can certainly add similar overloads to GetActive*Name.
#2
Rev. 2297 now contains GetActiveAttrib, GetActiveUniform, GetActiveUniformName and GetActiveUniformBlockName overloads that return strings.
Note that these overloads allocate memory and shouldn't be used during rendering. This is not typically a problem, as GetActive*() methods tend to be used at load-time. If this is a concern, you can use always cache a StringBuilder and use the old overloads instead.
#3
GetActiveUniformName returns garbage: 'Vertex sha'
Looks like a shader info log trimmed by uniform name max length.
#4
Please open new issues for new bugs! Moved here: #1265: New GetActiveUniformName overload returns garbage.