[PyOpenGL-Users] passing multiple values to glUniform
Brought to you by:
mcfletch
From: Gijs <in...@bs...> - 2009-03-11 11:30:00
|
Hello, I'm kinda running into a problem here using the glUniform functions. I use the following piece of code to set 8 values in the fragment shader: input_image = glGetUniformLocationARB(program, "input_image") glUniform1ivARB(input_image, 8, array([0, 1, 2, 3, 4, 5, 6, 7], 'i')) When I use that piece of code, I get the following error: glUniform1ivARB(input_image, 2, array([0, 1, 2, 3, 4, 5, 6, 7], 'i')) File "/Library/Python/2.5/site-packages/OpenGL/wrapper.py", line 1273, in __call__ return self.finalise()( *args, **named ) File "/Library/Python/2.5/site-packages/OpenGL/wrapper.py", line 543, in wrapperCall pyArgs = tuple( calculate_pyArgs( args )) File "/Library/Python/2.5/site-packages/OpenGL/wrapper.py", line 328, in calculate_pyArgs yield converter(args[index], self, args) File "/Library/Python/2.5/site-packages/OpenGL/arrays/arrayhelpers.py", line 41, in asArraySize incoming, ValueError: ('Expected 1 item array, got 8 item array', array([0, 1, 2, 3, 4, 5, 6, 7]), <function asArraySize at 0x6d79f0>) Now I don't really understand what I'm doing wrong. Passing only one value works perfectly, but I'd rather pass the entire array at once instead of passing every single value. (Python version 2.5.4, PyOpenGL version 3.0.0c1) Regards, Gijs |