FrameBufferObjectを作成したいのですが、失敗し、理由がわかりません。
これが私のコードです。4行目で次のエラーメッセージが表示されて失敗します。
エラー:
Traceback (most recent call last):
File "/home/julius/workspace/Bachelor/Final/Exporter/FBOtest.py", line 154, in <module>
fbo.mainGameLoop()
File "/home/julius/workspace/Bachelor/Final/Exporter/FBOtest.py", line 142, in mainGameLoop
self.createFBO()
File "/home/julius/workspace/Bachelor/Final/Exporter/FBOtest.py", line 55, in createFBO
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, self.depthbuffer)
File "/usr/lib/pymodules/python2.7/OpenGL/platform/baseplatform.py", line 335, in __call__
return self( *args, **named )
ctypes.ArgumentError: argument 2: <type 'exceptions.TypeError'>: wrong type
コード:
self.fbo = glGenFramebuffersEXT(1)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, self.fbo)
self.depthbuffer = glGenRenderbuffersEXT(GL_RENDERBUFFER_EXT)
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, self.depthbuffer)
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, height)
glFramebufferReadBufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, self.depthbuffer)
self.texture = glGenTextures(1)
glBindTexture(GL_TEXTURE_2D, self.texture)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_NEAREST)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_NEAREST)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, None);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, self.texture, 0);