satha
satha

Reputation: 41

NullFunctionError: Attempt to call an undefined alternate function (glGenFramebuffers, glGenFramebuffersEXT)

Currently I'm working with 3D objects rendering. In that while dealing with framebuffer part I'm getting some error.

self.fbo = glGenFramebuffers(1)

whenever interpreter hits this line its showing following error

**File "C:\Python27\lib\site-packages\OpenGL\latebind.py", line 44, in __call__
    self._finalCall = self.finalise()
  File "C:\Python27\lib\site-packages\OpenGL\extensions.py", line 189, in finalise
    self.__name__,
NullFunctionError: Attempt to call an undefined alternate function (glGenFramebuffers, glGenFramebuffersEXT), check for bool(glGenFramebuffers) before calling**

I'm using python 2.7.3 and pyOpenGL 3.0.2.I couldn't find any answer for this error.

Upvotes: 4

Views: 2749

Answers (1)

bio_c
bio_c

Reputation: 321

If bool(glGenFramebuffers) returns False, the error probably means that your computer does not have access to OpenGL >= 2.1 so Framebufffer objects won't work. Check your OpenGL supported version with GPU Caps Viewer for Windows. For Linux see here: https://askubuntu.com/questions/47062/what-is-terminal-command-that-can-show-opengl-version

If you have at least 2.1, then maybe the library you are using to create the context (pySDL, glut, pySFML, etc.) is not creating a compatible one. Fixing that depends on the library and probably already has an answer.

If bool(glGenFramebuffers) returns True, the problem might be somewhere else early in the code.

Also, remember that the context must be created and current before trying to create or use shaders, framebuffers, etc.

Upvotes: 3

Related Questions