Mike C. Fletcher wrote:
> Gijs wrote:
>> Hello List,
>> I am trying to use glDrawBuffers to render to multiple textures using
>> shaders. However, I'm running into a problem (otherwise I wouldn't be
>> posting here ofcourse :) ). When I call glDrawBuffers with *any*
>> buffer-type, it fails with the following error:
> Can you add this to tests/test.py and then alter it with fragments of
> your usage/code until it shows your error:
> def test_glDrawBuffers_list_valid( self ):
> """Test that glDrawBuffers with list argument where value is set"""
> fbo = glGenFramebuffersEXT(1)
> glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo)
> img1,img2 = glGenTextures(2)
> for img in img1,img2:
> glBindTexture( GL_TEXTURE_2D, img )
> GL_TEXTURE_2D, 0, GL_RGB8,
> 300, 300, 0, GL_RGB,
> None # no data transferred
> GL_TEXTURE_2D, img1, 0
> GL_TEXTURE_2D, img2, 0
> drawingBuffers = [
> glDrawBuffers(2, drawingBuffers )
> glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 )
> then send back the error-ing version so that I can look into what's
> going wrong without having to guess too much?
>> Hope someone knows what's going on under the hood.
> I *think* this should be working, I haven't had time to sit down and do
> shadow-casting myself, so I don't have any real-world code to test it.
> The code is pretty much just passing your values off to the C code, so
> there's not a lot under the hood that's PyOpenGL specific.
Thanks for your reply. I needed to cast some arguments (img, fbo) to int
and after that the code ran just fine, but the error remains (pasted
below). Also, I made a Python-C module to see whether the same error
would occur there. But with the exact same code in C, I could call
glDrawBuffers to draw to multiple buffers without any problems. So even
though the Python code should not really do much with the call, it does
something to mess it up.
Traceback (most recent call last):
File "./multiple-output.py", line 201, in <module>
File "./multiple-output.py", line 197, in test_glDrawBuffers_list_valid
line 275, in __call__
return self( *args, **named )
File "/Library/Python/2.5/site-packages/OpenGL/error.py", line 194, in
baseOperation = baseOperation,
err = 1280,
description = 'invalid enumerant',
baseOperation = glDrawBuffers,
cArguments = (