Re: [PyOpenGL-Users] glTexSubImage2D data format
Brought to you by:
mcfletch
|
From: Mohan G. <mg...@ca...> - 2009-11-10 18:16:13
|
Hi Gijs,
>I usually use Numpy arrays for calls like this. So something like this:
>data = zeros(width*height, 'f')+0.5
>glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height,
>GL_LUMINANCE, GL_FLOAT, data)
Thanks for the suggestion! Unfortunately I'm still getting an error... I'm
sure I'm doing something stupid, but would you mind taking a look at it? (I
can post the complete source code as well, but it's >100 lines, so I'm not
sure whether it's all right to send it to the list... )
thanks again,
Mohan
Error:
Traceback (most recent call last):
File "C:\Mohan\pygpu\test.py", line 110, in <module>
glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height,
GL_LUMINAN CE, GL_FLOAT, data)
File "C:\Program
Files\_Coding\Python26\lib\site-packages\OpenGL\wrapper.py", line 1284, in
__call__
return self.finalise()( *args, **named )
File "C:\Program
Files\_Coding\Python26\lib\site-packages\OpenGL\wrapper.py", line 681, in
wrapperCall
raise err
OpenGL.error.GLError: GLError(
err = 1281,
description = 'invalid value',
baseOperation = glTexSubImage2D,
pyArgs = (
GL_TEXTURE_RECTANGLE_ARB,
0,
0,
0,
512,
512,
GL_LUMINANCE,
GL_FLOAT,
array([ 0.30000001, 0.30000001, 0.3...,
),
cArgs = (
GL_TEXTURE_RECTANGLE_ARB,
0,
0,
0,
512,
512,
GL_LUMINANCE,
GL_FLOAT,
array([ 0.30000001, 0.30000001, 0.3...,
),
cArguments = (
GL_TEXTURE_RECTANGLE_ARB,
0,
0,
0,
512,
512,
GL_LUMINANCE,
GL_FLOAT,
c_void_p(90243104),
)
)
|