On 10-06-06 12:26 PM, Gijs wrote:
> Glad we cleared that up :)
> Anyway, I tried it out, but I couldn't get it to work either.
> glGetUniformfv seemed to be defined as glGetUniformfv(programloc,
> varloc, returnvalues) in PyOpenGL, same as the default C spec. Normal
> PyOpenGL functions aren't defined this way. As you said, the return
> values are normally returned instead of passed along with the function
> When I tried to call it with three parameters, it did not even touch
> the returnvariable. So I assume there is a bug somewhere. Also, the
> function requires an array to be passed as a returnvariable, but the
> return value is always one value, never an array. You simply cannot
> ask for the values of an entire shader-array. You'd need to call
> glGetUniformfv for each element of the array.
> It might work if you pass a ctypes float along with it, however I have
> no experience with ctypes stuff, so I'll leave that to the experts.
This function should get wrapped to create the array automatically. In
the meantime, this is a sample that should work:
test_lights = (GLfloat * 12)()
self.uniform_locations['lights'], test_lights )
print 'Lights', list(test_lights)
You should be able to pass any writable PyOpenGL array type (e.g. a
numpy array) as params.
> On 6/6/10 16:06 , Ian Mallett wrote:
>> On Sun, Jun 6, 2010 at 1:31 AM, Gijs <info@...
>> <mailto:info@...>> wrote:
>> I don't think I've ever had to use it before, but you usually
>> give the program location and the variable location. So it would
>> be something like this:
>> value = glGetUniformfv(programloc, varloc)
>> Oops! I actually tried that. Typo.
>> Should have been:
Mike C. Fletcher
Designer, VR Plumber, Coder