Re: [PyOpenGL-Users] glGetUniformLocation causes segmentation faults
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2009-07-05 20:58:02
|
Ian Mallett wrote: > On Sun, Jul 5, 2009 at 12:39 PM, Mike C. Fletcher > <mcf...@vr... <mailto:mcf...@vr...>> wrote: > > Ian Mallett wrote: > > > This might be a good time to bring up a long standing issue. > > Personally, I'm getting null function errors--the only way I've > gotten > > shaders to work is with ARB, and I'm not sure why. > Missed this. > > Can you give more details and/or a test-case? > > Well, this <http://www.pygame.org/wiki/GLSLExample?parent=CookBook> > didn't work... > > I might have been referring to simple tests like: > > >>> from OpenGL.GL import * > >>> glCreateShader > <OpenGL.platform.baseplatform.glCreateShader object at 0x02C03090> > >>> glCreateShader() > Traceback (most recent call last): > File "<pyshell#2>", line 1, in <module> > glCreateShader() > File > "C:\dev\Python25\Lib\site-packages\OpenGL\platform\baseplatform.py", > line 299, in __call__ > self.__name__, self.__name__, > NullFunctionError: Attempt to call an undefined function > glCreateShader, check for bool(glCreateShader) before calling > > Simply missing something? You don't have a valid OpenGL context at this point, without that many of the newer GL implementations will return NULL pointers when you try to get the pointer. Some will even silently return NULL values (without raising errors!) when there's no active context. That's all reasonably spec-compliant, but a bit of a PITA IMO. Maybe I'm missing something, though. You do *way* more work with PyOpenGL than me, so I could quite easily have missed a common failure-case. Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |